Upgrade SBI(Service-based Interface)

* OpenAPI Generator version: 4.3.1 ==> 5.5.1
* Specification : r16.8.0 (20210629)
This commit is contained in:
Sukchan Lee 2021-07-07 17:32:55 +09:00
parent 2aaa8200c2
commit f278d58a69
1914 changed files with 91329 additions and 57361 deletions

View file

@ -0,0 +1,697 @@
CMakeLists.txt
README.md
api/IndividualSubscriptionDocumentAPI.c
api/IndividualSubscriptionDocumentAPI.h
api/IndividualUeContextDocumentAPI.c
api/IndividualUeContextDocumentAPI.h
api/N1N2IndividualSubscriptionDocumentAPI.c
api/N1N2IndividualSubscriptionDocumentAPI.h
api/N1N2MessageCollectionDocumentAPI.c
api/N1N2MessageCollectionDocumentAPI.h
api/N1N2SubscriptionsCollectionForIndividualUEContextsDocumentAPI.c
api/N1N2SubscriptionsCollectionForIndividualUEContextsDocumentAPI.h
api/NonUEN2MessageNotificationIndividualSubscriptionDocumentAPI.c
api/NonUEN2MessageNotificationIndividualSubscriptionDocumentAPI.h
api/NonUEN2MessagesCollectionDocumentAPI.c
api/NonUEN2MessagesCollectionDocumentAPI.h
api/NonUEN2MessagesSubscriptionsCollectionDocumentAPI.c
api/NonUEN2MessagesSubscriptionsCollectionDocumentAPI.h
api/SubscriptionsCollectionDocumentAPI.c
api/SubscriptionsCollectionDocumentAPI.h
docs/IndividualSubscriptionDocumentAPI.md
docs/IndividualUeContextDocumentAPI.md
docs/N1N2IndividualSubscriptionDocumentAPI.md
docs/N1N2MessageCollectionDocumentAPI.md
docs/N1N2SubscriptionsCollectionForIndividualUEContextsDocumentAPI.md
docs/NonUEN2MessageNotificationIndividualSubscriptionDocumentAPI.md
docs/NonUEN2MessagesCollectionDocumentAPI.md
docs/NonUEN2MessagesSubscriptionsCollectionDocumentAPI.md
docs/SubscriptionsCollectionDocumentAPI.md
docs/access_token_err.md
docs/access_token_req.md
docs/access_type.md
docs/allowed_nssai.md
docs/allowed_snssai.md
docs/ambr.md
docs/amf_event.md
docs/amf_event_area.md
docs/amf_event_mode.md
docs/amf_event_subscription.md
docs/amf_event_subscription_add_info.md
docs/amf_event_trigger.md
docs/amf_event_trigger_any_of.md
docs/amf_event_type.md
docs/amf_event_type_any_of.md
docs/amf_status_change_notification.md
docs/amf_status_change_subscription_data.md
docs/amf_status_info.md
docs/area.md
docs/area_of_validity.md
docs/area_scope.md
docs/arp.md
docs/assign_ebi_data.md
docs/assign_ebi_error.md
docs/assign_ebi_failed.md
docs/assigned_ebi_data.md
docs/auth_status.md
docs/battery_indication.md
docs/cag_data.md
docs/cag_info.md
docs/ce_mode_b_ind.md
docs/ciphering_algorithm.md
docs/cn_assisted_ran_para.md
docs/collection_period_rmm_lte_mdt.md
docs/collection_period_rmm_nr_mdt.md
docs/configured_snssai.md
docs/core_network_type.md
docs/ddd_traffic_descriptor.md
docs/ebi_arp_mapping.md
docs/ec_restriction_data_wb.md
docs/ecgi.md
docs/eps_nas_ciphering_algorithm.md
docs/eps_nas_integrity_algorithm.md
docs/eps_nas_security_mode.md
docs/eutra_location.md
docs/expected_ue_behavior.md
docs/ext_amf_event_subscription.md
docs/global_ran_node_id.md
docs/gnb_id.md
docs/guami.md
docs/hfc_node_id.md
docs/immediate_mdt_conf.md
docs/inline_object.md
docs/inline_object_1.md
docs/inline_object_2.md
docs/inline_object_3.md
docs/inline_object_4.md
docs/integrity_algorithm.md
docs/invalid_param.md
docs/job_type.md
docs/key_amf.md
docs/key_amf_type.md
docs/ladn_info.md
docs/line_type.md
docs/location_filter.md
docs/location_filter_any_of.md
docs/lte_m_ind.md
docs/lte_v2x_auth.md
docs/measurement_lte_for_mdt.md
docs/measurement_nr_for_mdt.md
docs/measurement_period_lte_mdt.md
docs/mm_context.md
docs/mo_exp_data_counter.md
docs/n1_message_class.md
docs/n1_message_container.md
docs/n1_message_notification.md
docs/n1_n2_message_transfer_cause.md
docs/n1_n2_message_transfer_error.md
docs/n1_n2_message_transfer_req_data.md
docs/n1_n2_message_transfer_rsp_data.md
docs/n1_n2_msg_txfr_err_detail.md
docs/n1_n2_msg_txfr_failure_notification.md
docs/n2_info_container.md
docs/n2_info_content.md
docs/n2_info_notification_rsp_data.md
docs/n2_info_notify_reason.md
docs/n2_information_class.md
docs/n2_information_notification.md
docs/n2_information_transfer_error.md
docs/n2_information_transfer_req_data.md
docs/n2_information_transfer_result.md
docs/n2_information_transfer_rsp_data.md
docs/n2_ran_information.md
docs/n2_sm_information.md
docs/n3ga_location.md
docs/nas_security_mode.md
docs/ncgi.md
docs/nf_type.md
docs/ng_ap_cause.md
docs/ng_ksi.md
docs/ng_ran_target_id.md
docs/ngap_ie_type.md
docs/non_ue_n2_info_subscription_create_data.md
docs/non_ue_n2_info_subscription_created_data.md
docs/npn_access_info.md
docs/nr_location.md
docs/nr_v2x_auth.md
docs/nrppa_information.md
docs/nsi_information.md
docs/nssaa_status.md
docs/nssai_mapping.md
docs/pc5_flow_bit_rates.md
docs/pc5_qo_s_para.md
docs/pc5_qos_flow_item.md
docs/pdu_session_context.md
docs/periodic_communication_indicator.md
docs/plmn_id.md
docs/plmn_id_nid.md
docs/policy_req_trigger.md
docs/positioning_method_mdt.md
docs/preemption_capability.md
docs/preemption_vulnerability.md
docs/presence_info.md
docs/presence_state.md
docs/problem_details.md
docs/pws_error_data.md
docs/pws_information.md
docs/pws_response_data.md
docs/rat_selector.md
docs/rat_type.md
docs/reachability_filter.md
docs/reachability_filter_any_of.md
docs/redirect_response.md
docs/ref_to_binary_data.md
docs/registration_context_container.md
docs/report_amount_mdt.md
docs/report_interval_mdt.md
docs/report_interval_nr_mdt.md
docs/reporting_trigger.md
docs/restriction_type.md
docs/sbi_binding_level.md
docs/sc_type.md
docs/scheduled_communication_time.md
docs/scheduled_communication_type.md
docs/seaf_data.md
docs/sensor_measurement.md
docs/service_area_restriction.md
docs/small_data_rate_status.md
docs/small_data_rate_status_info.md
docs/smf_change_indication.md
docs/smf_change_info.md
docs/sms_support.md
docs/snssai.md
docs/stationary_indication.md
docs/status_change.md
docs/tac_info.md
docs/tai.md
docs/tnap_id.md
docs/trace_data.md
docs/trace_depth.md
docs/traffic_descriptor.md
docs/traffic_profile.md
docs/transfer_reason.md
docs/twap_id.md
docs/ue_auth.md
docs/ue_context.md
docs/ue_context_cancel_relocate_data.md
docs/ue_context_create_data.md
docs/ue_context_create_error.md
docs/ue_context_created_data.md
docs/ue_context_release.md
docs/ue_context_relocate_data.md
docs/ue_context_relocated_data.md
docs/ue_context_transfer_req_data.md
docs/ue_context_transfer_rsp_data.md
docs/ue_context_transfer_status.md
docs/ue_differentiation_info.md
docs/ue_n1_n2_info_subscription_create_data.md
docs/ue_n1_n2_info_subscription_created_data.md
docs/ue_reg_status_update_req_data.md
docs/ue_reg_status_update_rsp_data.md
docs/user_location.md
docs/v2x_context.md
docs/v2x_information.md
external/cJSON.c
external/cJSON.h
external/cJSON.licence
include/apiClient.h
include/binary.h
include/keyValuePair.h
include/list.h
libcurl.licence
model/access_token_err.c
model/access_token_err.h
model/access_token_req.c
model/access_token_req.h
model/access_type.c
model/access_type.h
model/allowed_nssai.c
model/allowed_nssai.h
model/allowed_snssai.c
model/allowed_snssai.h
model/ambr.c
model/ambr.h
model/amf_event.c
model/amf_event.h
model/amf_event_area.c
model/amf_event_area.h
model/amf_event_mode.c
model/amf_event_mode.h
model/amf_event_subscription.c
model/amf_event_subscription.h
model/amf_event_subscription_add_info.c
model/amf_event_subscription_add_info.h
model/amf_event_trigger.c
model/amf_event_trigger.h
model/amf_event_trigger_any_of.c
model/amf_event_trigger_any_of.h
model/amf_event_type.c
model/amf_event_type.h
model/amf_event_type_any_of.c
model/amf_event_type_any_of.h
model/amf_status_change_notification.c
model/amf_status_change_notification.h
model/amf_status_change_subscription_data.c
model/amf_status_change_subscription_data.h
model/amf_status_info.c
model/amf_status_info.h
model/area.c
model/area.h
model/area_of_validity.c
model/area_of_validity.h
model/area_scope.c
model/area_scope.h
model/arp.c
model/arp.h
model/assign_ebi_data.c
model/assign_ebi_data.h
model/assign_ebi_error.c
model/assign_ebi_error.h
model/assign_ebi_failed.c
model/assign_ebi_failed.h
model/assigned_ebi_data.c
model/assigned_ebi_data.h
model/auth_status.c
model/auth_status.h
model/battery_indication.c
model/battery_indication.h
model/cag_data.c
model/cag_data.h
model/cag_info.c
model/cag_info.h
model/ce_mode_b_ind.c
model/ce_mode_b_ind.h
model/ciphering_algorithm.c
model/ciphering_algorithm.h
model/cn_assisted_ran_para.c
model/cn_assisted_ran_para.h
model/collection_period_rmm_lte_mdt.c
model/collection_period_rmm_lte_mdt.h
model/collection_period_rmm_nr_mdt.c
model/collection_period_rmm_nr_mdt.h
model/configured_snssai.c
model/configured_snssai.h
model/core_network_type.c
model/core_network_type.h
model/ddd_traffic_descriptor.c
model/ddd_traffic_descriptor.h
model/ebi_arp_mapping.c
model/ebi_arp_mapping.h
model/ec_restriction_data_wb.c
model/ec_restriction_data_wb.h
model/ecgi.c
model/ecgi.h
model/eps_nas_ciphering_algorithm.c
model/eps_nas_ciphering_algorithm.h
model/eps_nas_integrity_algorithm.c
model/eps_nas_integrity_algorithm.h
model/eps_nas_security_mode.c
model/eps_nas_security_mode.h
model/eutra_location.c
model/eutra_location.h
model/expected_ue_behavior.c
model/expected_ue_behavior.h
model/ext_amf_event_subscription.c
model/ext_amf_event_subscription.h
model/global_ran_node_id.c
model/global_ran_node_id.h
model/gnb_id.c
model/gnb_id.h
model/guami.c
model/guami.h
model/hfc_node_id.c
model/hfc_node_id.h
model/immediate_mdt_conf.c
model/immediate_mdt_conf.h
model/inline_object.c
model/inline_object.h
model/inline_object_1.c
model/inline_object_1.h
model/inline_object_2.c
model/inline_object_2.h
model/inline_object_3.c
model/inline_object_3.h
model/inline_object_4.c
model/inline_object_4.h
model/integrity_algorithm.c
model/integrity_algorithm.h
model/invalid_param.c
model/invalid_param.h
model/job_type.c
model/job_type.h
model/key_amf.c
model/key_amf.h
model/key_amf_type.c
model/key_amf_type.h
model/ladn_info.c
model/ladn_info.h
model/line_type.c
model/line_type.h
model/location_filter.c
model/location_filter.h
model/location_filter_any_of.c
model/location_filter_any_of.h
model/lte_m_ind.c
model/lte_m_ind.h
model/lte_v2x_auth.c
model/lte_v2x_auth.h
model/measurement_lte_for_mdt.c
model/measurement_lte_for_mdt.h
model/measurement_nr_for_mdt.c
model/measurement_nr_for_mdt.h
model/measurement_period_lte_mdt.c
model/measurement_period_lte_mdt.h
model/mm_context.c
model/mm_context.h
model/mo_exp_data_counter.c
model/mo_exp_data_counter.h
model/n1_message_class.c
model/n1_message_class.h
model/n1_message_container.c
model/n1_message_container.h
model/n1_message_notification.c
model/n1_message_notification.h
model/n1_n2_message_transfer_cause.c
model/n1_n2_message_transfer_cause.h
model/n1_n2_message_transfer_error.c
model/n1_n2_message_transfer_error.h
model/n1_n2_message_transfer_req_data.c
model/n1_n2_message_transfer_req_data.h
model/n1_n2_message_transfer_rsp_data.c
model/n1_n2_message_transfer_rsp_data.h
model/n1_n2_msg_txfr_err_detail.c
model/n1_n2_msg_txfr_err_detail.h
model/n1_n2_msg_txfr_failure_notification.c
model/n1_n2_msg_txfr_failure_notification.h
model/n2_info_container.c
model/n2_info_container.h
model/n2_info_content.c
model/n2_info_content.h
model/n2_info_notification_rsp_data.c
model/n2_info_notification_rsp_data.h
model/n2_info_notify_reason.c
model/n2_info_notify_reason.h
model/n2_information_class.c
model/n2_information_class.h
model/n2_information_notification.c
model/n2_information_notification.h
model/n2_information_transfer_error.c
model/n2_information_transfer_error.h
model/n2_information_transfer_req_data.c
model/n2_information_transfer_req_data.h
model/n2_information_transfer_result.c
model/n2_information_transfer_result.h
model/n2_information_transfer_rsp_data.c
model/n2_information_transfer_rsp_data.h
model/n2_ran_information.c
model/n2_ran_information.h
model/n2_sm_information.c
model/n2_sm_information.h
model/n3ga_location.c
model/n3ga_location.h
model/nas_security_mode.c
model/nas_security_mode.h
model/ncgi.c
model/ncgi.h
model/nf_type.c
model/nf_type.h
model/ng_ap_cause.c
model/ng_ap_cause.h
model/ng_ksi.c
model/ng_ksi.h
model/ng_ran_target_id.c
model/ng_ran_target_id.h
model/ngap_ie_type.c
model/ngap_ie_type.h
model/non_ue_n2_info_subscription_create_data.c
model/non_ue_n2_info_subscription_create_data.h
model/non_ue_n2_info_subscription_created_data.c
model/non_ue_n2_info_subscription_created_data.h
model/npn_access_info.c
model/npn_access_info.h
model/nr_location.c
model/nr_location.h
model/nr_v2x_auth.c
model/nr_v2x_auth.h
model/nrppa_information.c
model/nrppa_information.h
model/nsi_information.c
model/nsi_information.h
model/nssaa_status.c
model/nssaa_status.h
model/nssai_mapping.c
model/nssai_mapping.h
model/object.c
model/object.h
model/pc5_flow_bit_rates.c
model/pc5_flow_bit_rates.h
model/pc5_qo_s_para.c
model/pc5_qo_s_para.h
model/pc5_qos_flow_item.c
model/pc5_qos_flow_item.h
model/pdu_session_context.c
model/pdu_session_context.h
model/periodic_communication_indicator.c
model/periodic_communication_indicator.h
model/plmn_id.c
model/plmn_id.h
model/plmn_id_nid.c
model/plmn_id_nid.h
model/policy_req_trigger.c
model/policy_req_trigger.h
model/positioning_method_mdt.c
model/positioning_method_mdt.h
model/preemption_capability.c
model/preemption_capability.h
model/preemption_vulnerability.c
model/preemption_vulnerability.h
model/presence_info.c
model/presence_info.h
model/presence_state.c
model/presence_state.h
model/problem_details.c
model/problem_details.h
model/pws_error_data.c
model/pws_error_data.h
model/pws_information.c
model/pws_information.h
model/pws_response_data.c
model/pws_response_data.h
model/rat_selector.c
model/rat_selector.h
model/rat_type.c
model/rat_type.h
model/reachability_filter.c
model/reachability_filter.h
model/reachability_filter_any_of.c
model/reachability_filter_any_of.h
model/redirect_response.c
model/redirect_response.h
model/ref_to_binary_data.c
model/ref_to_binary_data.h
model/registration_context_container.c
model/registration_context_container.h
model/report_amount_mdt.c
model/report_amount_mdt.h
model/report_interval_mdt.c
model/report_interval_mdt.h
model/report_interval_nr_mdt.c
model/report_interval_nr_mdt.h
model/reporting_trigger.c
model/reporting_trigger.h
model/restriction_type.c
model/restriction_type.h
model/sbi_binding_level.c
model/sbi_binding_level.h
model/sc_type.c
model/sc_type.h
model/scheduled_communication_time.c
model/scheduled_communication_time.h
model/scheduled_communication_type.c
model/scheduled_communication_type.h
model/seaf_data.c
model/seaf_data.h
model/sensor_measurement.c
model/sensor_measurement.h
model/service_area_restriction.c
model/service_area_restriction.h
model/small_data_rate_status.c
model/small_data_rate_status.h
model/small_data_rate_status_info.c
model/small_data_rate_status_info.h
model/smf_change_indication.c
model/smf_change_indication.h
model/smf_change_info.c
model/smf_change_info.h
model/sms_support.c
model/sms_support.h
model/snssai.c
model/snssai.h
model/stationary_indication.c
model/stationary_indication.h
model/status_change.c
model/status_change.h
model/tac_info.c
model/tac_info.h
model/tai.c
model/tai.h
model/tnap_id.c
model/tnap_id.h
model/trace_data.c
model/trace_data.h
model/trace_depth.c
model/trace_depth.h
model/traffic_descriptor.c
model/traffic_descriptor.h
model/traffic_profile.c
model/traffic_profile.h
model/transfer_reason.c
model/transfer_reason.h
model/twap_id.c
model/twap_id.h
model/ue_auth.c
model/ue_auth.h
model/ue_context.c
model/ue_context.h
model/ue_context_cancel_relocate_data.c
model/ue_context_cancel_relocate_data.h
model/ue_context_create_data.c
model/ue_context_create_data.h
model/ue_context_create_error.c
model/ue_context_create_error.h
model/ue_context_created_data.c
model/ue_context_created_data.h
model/ue_context_release.c
model/ue_context_release.h
model/ue_context_relocate_data.c
model/ue_context_relocate_data.h
model/ue_context_relocated_data.c
model/ue_context_relocated_data.h
model/ue_context_transfer_req_data.c
model/ue_context_transfer_req_data.h
model/ue_context_transfer_rsp_data.c
model/ue_context_transfer_rsp_data.h
model/ue_context_transfer_status.c
model/ue_context_transfer_status.h
model/ue_differentiation_info.c
model/ue_differentiation_info.h
model/ue_n1_n2_info_subscription_create_data.c
model/ue_n1_n2_info_subscription_create_data.h
model/ue_n1_n2_info_subscription_created_data.c
model/ue_n1_n2_info_subscription_created_data.h
model/ue_reg_status_update_req_data.c
model/ue_reg_status_update_req_data.h
model/ue_reg_status_update_rsp_data.c
model/ue_reg_status_update_rsp_data.h
model/user_location.c
model/user_location.h
model/v2x_context.c
model/v2x_context.h
model/v2x_information.c
model/v2x_information.h
src/apiClient.c
src/apiKey.c
src/binary.c
src/list.c
uncrustify-rules.cfg
unit-test/test_amf_event.c
unit-test/test_amf_event_area.c
unit-test/test_amf_event_mode.c
unit-test/test_amf_event_subscription.c
unit-test/test_amf_event_subscription_add_info.c
unit-test/test_amf_event_trigger.c
unit-test/test_amf_event_trigger_any_of.c
unit-test/test_amf_event_type.c
unit-test/test_amf_event_type_any_of.c
unit-test/test_amf_status_change_notification.c
unit-test/test_amf_status_change_subscription_data.c
unit-test/test_amf_status_info.c
unit-test/test_area_of_validity.c
unit-test/test_assign_ebi_data.c
unit-test/test_assign_ebi_error.c
unit-test/test_assign_ebi_failed.c
unit-test/test_assigned_ebi_data.c
unit-test/test_auth_status.c
unit-test/test_ce_mode_b_ind.c
unit-test/test_ciphering_algorithm.c
unit-test/test_eps_nas_ciphering_algorithm.c
unit-test/test_eps_nas_integrity_algorithm.c
unit-test/test_eps_nas_security_mode.c
unit-test/test_expected_ue_behavior.c
unit-test/test_ext_amf_event_subscription.c
unit-test/test_immediate_mdt_conf.c
unit-test/test_integrity_algorithm.c
unit-test/test_key_amf.c
unit-test/test_key_amf_type.c
unit-test/test_ladn_info.c
unit-test/test_location_filter.c
unit-test/test_location_filter_any_of.c
unit-test/test_lte_m_ind.c
unit-test/test_mm_context.c
unit-test/test_n1_message_container.c
unit-test/test_n1_message_notification.c
unit-test/test_n1_n2_message_transfer_cause.c
unit-test/test_n1_n2_message_transfer_error.c
unit-test/test_n1_n2_message_transfer_req_data.c
unit-test/test_n1_n2_message_transfer_rsp_data.c
unit-test/test_n1_n2_msg_txfr_err_detail.c
unit-test/test_n1_n2_msg_txfr_failure_notification.c
unit-test/test_n2_info_container.c
unit-test/test_n2_info_content.c
unit-test/test_n2_info_notification_rsp_data.c
unit-test/test_n2_info_notify_reason.c
unit-test/test_n2_information_notification.c
unit-test/test_n2_information_transfer_error.c
unit-test/test_n2_information_transfer_req_data.c
unit-test/test_n2_information_transfer_result.c
unit-test/test_n2_information_transfer_rsp_data.c
unit-test/test_n2_ran_information.c
unit-test/test_n2_sm_information.c
unit-test/test_nas_security_mode.c
unit-test/test_ng_ksi.c
unit-test/test_ngap_ie_type.c
unit-test/test_non_ue_n2_info_subscription_create_data.c
unit-test/test_non_ue_n2_info_subscription_created_data.c
unit-test/test_npn_access_info.c
unit-test/test_nrppa_information.c
unit-test/test_nssaa_status.c
unit-test/test_nssai_mapping.c
unit-test/test_pc5_flow_bit_rates.c
unit-test/test_pc5_qo_s_para.c
unit-test/test_pc5_qos_flow_item.c
unit-test/test_pdu_session_context.c
unit-test/test_periodic_communication_indicator.c
unit-test/test_policy_req_trigger.c
unit-test/test_pws_error_data.c
unit-test/test_pws_information.c
unit-test/test_pws_response_data.c
unit-test/test_rat_selector.c
unit-test/test_reachability_filter.c
unit-test/test_reachability_filter_any_of.c
unit-test/test_registration_context_container.c
unit-test/test_sc_type.c
unit-test/test_seaf_data.c
unit-test/test_small_data_rate_status_info.c
unit-test/test_smf_change_indication.c
unit-test/test_smf_change_info.c
unit-test/test_status_change.c
unit-test/test_traffic_descriptor.c
unit-test/test_transfer_reason.c
unit-test/test_ue_context.c
unit-test/test_ue_context_cancel_relocate_data.c
unit-test/test_ue_context_create_data.c
unit-test/test_ue_context_create_error.c
unit-test/test_ue_context_created_data.c
unit-test/test_ue_context_release.c
unit-test/test_ue_context_relocate_data.c
unit-test/test_ue_context_relocated_data.c
unit-test/test_ue_context_transfer_req_data.c
unit-test/test_ue_context_transfer_rsp_data.c
unit-test/test_ue_context_transfer_status.c
unit-test/test_ue_differentiation_info.c
unit-test/test_ue_n1_n2_info_subscription_create_data.c
unit-test/test_ue_n1_n2_info_subscription_created_data.c
unit-test/test_ue_reg_status_update_req_data.c
unit-test/test_ue_reg_status_update_rsp_data.c
unit-test/test_v2x_context.c
unit-test/test_v2x_information.c

View file

@ -1 +1 @@
4.3.1-SNAPSHOT
5.1.1

View file

@ -1,8 +0,0 @@
enablePostProcessFile: true
templateDir: "../openapi/.openapi-generator/templates"
reservedWordMappings:
3GPP_ACCESS: "3GPP_ACCESS"
5G_EIR: "5G_EIR"
5G_AKA: "5G_AKA"
5G_HE_AKA: "5G_HE_AKA"
5GMM: "5GMM"

View file

@ -1,25 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include "../include/keyValuePair.h"
OpenAPI_map_t *OpenAPI_map_create(char *key, void *value)
{
OpenAPI_map_t *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);
}

View file

@ -1,65 +0,0 @@
#include <stdlib.h>
#include <string.h>
#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
}

View file

@ -1,27 +0,0 @@
#ifndef OGS_SBI_BINARY_H
#define OGS_SBI_BINARY_H
#include <stdint.h>
#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

File diff suppressed because it is too large Load diff

View file

@ -1,277 +0,0 @@
/*
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
/* project version */
#define CJSON_VERSION_MAJOR 1
#define CJSON_VERSION_MINOR 7
#define CJSON_VERSION_PATCH 7
#include <stddef.h>
/* 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
{
void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr);
} cJSON_Hooks;
typedef int cJSON_bool;
#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 2 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
*/
/* 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 __stdcall
#elif defined(CJSON_EXPORT_SYMBOLS)
#define CJSON_PUBLIC(type) __declspec(dllexport) type __stdcall
#elif defined(CJSON_IMPORT_SYMBOLS)
#define CJSON_PUBLIC(type) __declspec(dllimport) type __stdcall
#endif
#else /* !WIN32 */
#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
/* 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);
/* 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);
/* 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 *c);
/* 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 if the item is a string and return its valuestring */
CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *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/arrray 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. */
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 **strings, int count);
/* Append item to the specified array/object. */
CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item);
CJSON_PUBLIC(void) 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(void) 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(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item);
/* Remove/Detatch 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(void) 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(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem);
CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
CJSON_PUBLIC(void) 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);
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))
/* 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

View file

@ -1,25 +0,0 @@
#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 */

View file

@ -1,171 +0,0 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include "../include/list.h"
static OpenAPI_lnode_t *listEntry_create(void *data)
{
OpenAPI_lnode_t *created = ogs_malloc(sizeof(OpenAPI_lnode_t));
ogs_assert(created);
if (created == NULL) {
// TODO Malloc Failure
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) {
// TODO Malloc Failure
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_add(OpenAPI_list_t *list, void *dataToAddInList)
{
OpenAPI_lnode_t *newListEntry = listEntry_create(dataToAddInList);
if (newListEntry == NULL) {
// TODO Malloc Failure
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_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;
}
}

View file

@ -1,54 +0,0 @@
#ifndef OGS_SBI_LIST_H
#define OGS_SBI_LIST_H
#include "../external/cJSON.h"
#include "ogs-core.h"
#ifdef __cplusplus
extern "C" {
#endif
#define OpenAPI_malloc(__sIZE) __sIZE == 0 ? NULL : ogs_malloc_or_assert(__sIZE)
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_add(OpenAPI_list_t *list, 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);
#ifdef __cplusplus
}
#endif
#endif // OGS_SBI_LIST_H

View file

@ -1,814 +0,0 @@
{{#models}}{{#model}}
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "{{classname}}.h"
{{#isEnum}}
char* OpenAPI_{{classname}}_ToString(OpenAPI_{{classVarName}}_e {{classname}})
{
const char *{{classname}}Array[] = { "NULL"{{#allowableValues}}{{#enumVars}}, "{{{value}}}"{{/enumVars}}{{/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}}{{#enumVars}}, "{{{value}}}"{{/enumVars}}{{/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}}{{#enumVars}}, "{{{value}}}"{{/enumVars}}{{/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}}{{#enumVars}}, "{{{value}}}"{{/enumVars}}{{/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}}{{#hasMore}},{{/hasMore}}
{{/isEnum}}
{{^isEnum}}
{{#isModel}}
OpenAPI_{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isModel}}
{{#isUuid}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isUuid}}
{{#isEmail}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isEmail}}
{{#isFreeFormObject}}
OpenAPI_{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isFreeFormObject}}
{{/isEnum}}
{{/isPrimitiveType}}
{{#isPrimitiveType}}
{{#isEnum}}
OpenAPI_{{classVarName}}_{{name}}_e {{name}}{{#hasMore}},{{/hasMore}}
{{/isEnum}}
{{^isEnum}}
{{#isNumeric}}
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isNumeric}}
{{#isBoolean}}
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isBoolean}}
{{#isString}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isString}}
{{/isEnum}}
{{#isByteArray}}
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isByteArray}}
{{#isBinary}}
OpenAPI_{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isBinary}}
{{#isDate}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isDate}}
{{#isDateTime}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isDateTime}}
{{/isPrimitiveType}}
{{/isContainer}}
{{#isContainer}}
{{#isListContainer}}
OpenAPI_{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isListContainer}}
{{#isMapContainer}}
OpenAPI_{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isMapContainer}}
{{/isContainer}}
{{/vars}})
{
OpenAPI_{{classname}}_t *{{classname}}_local_var = OpenAPI_malloc(sizeof(OpenAPI_{{classname}}_t));
if (!{{classname}}_local_var) {
return NULL;
}
{{#vars}}
{{classname}}_local_var->{{{name}}} = {{{name}}};
{{/vars}}
return {{classname}}_local_var;
}
void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}})
{
if (NULL == {{classname}}) {
return ;
}
OpenAPI_lnode_t *node;
{{#vars}}
{{^isContainer}}
{{^isPrimitiveType}}
{{^isEnum}}
{{#isModel}}
OpenAPI_{{{complexType}}}_free({{{classname}}}->{{{name}}});
{{/isModel}}
{{#isUuid}}
ogs_free({{{classname}}}->{{{name}}});
{{/isUuid}}
{{#isEmail}}
ogs_free({{{classname}}}->{{{name}}});
{{/isEmail}}
{{#isFreeFormObject}}
OpenAPI_object_free({{{classname}}}->{{{name}}});
{{/isFreeFormObject}}
{{/isEnum}}
{{/isPrimitiveType}}
{{#isPrimitiveType}}
{{^isEnum}}
{{#isString}}
ogs_free({{{classname}}}->{{{name}}});
{{/isString}}
{{/isEnum}}
{{#isBinary}}
ogs_free({{{classname}}}->{{{name}}}->data);
{{/isBinary}}
{{#isDate}}
ogs_free({{{classname}}}->{{{name}}});
{{/isDate}}
{{#isDateTime}}
ogs_free({{{classname}}}->{{{name}}});
{{/isDateTime}}
{{/isPrimitiveType}}
{{/isContainer}}
{{#isContainer}}
{{#isListContainer}}
{{#isPrimitiveType}}
{{^isEnum}}
OpenAPI_list_for_each({{classname}}->{{name}}, node) {
ogs_free(node->data);
}
{{/isEnum}}
OpenAPI_list_free({{classname}}->{{name}});
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{^isEnum}}
OpenAPI_list_for_each({{classname}}->{{name}}, node) {
OpenAPI_{{complexType}}_free(node->data);
}
{{/isEnum}}
OpenAPI_list_free({{classname}}->{{name}});
{{/isPrimitiveType}}
{{/isListContainer}}
{{#isMapContainer}}
{{#isPrimitiveType}}
OpenAPI_list_for_each({{classname}}->{{name}}, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->value);
ogs_free(localKeyValue);
}
OpenAPI_list_free({{classname}}->{{name}});
{{/isPrimitiveType}}
{{^isPrimitiveType}}
OpenAPI_list_for_each({{classname}}->{{name}}, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
OpenAPI_{{complexType}}_free(localKeyValue->value);
ogs_free(localKeyValue);
}
OpenAPI_list_free({{classname}}->{{name}});
{{/isPrimitiveType}}
{{/isMapContainer}}
{{/isContainer}}
{{/vars}}
ogs_free({{classname}});
}
cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname}})
{
cJSON *item = NULL;
if ({{classname}} == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
return NULL;
}
item = cJSON_CreateObject();
{{#vars}}
{{^required}}
if ({{{classname}}}->{{{name}}}) {
{{/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}}
{{#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}}
{{#isString}}
if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isString}}
{{/isEnum}}
{{#isByteArray}}
if (cJSON_AddNumberToObject(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) {
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}}
{{#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}}
{{/isEnum}}
{{/isPrimitiveType}}
{{/isContainer}}
{{#isContainer}}
{{#isListContainer}}
{{#isPrimitiveType}}
{{^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) {
{{#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}}
}
{{/isEnum}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{^isEnum}}
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);
}
}
{{/isEnum}}
{{#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}}
{{/isPrimitiveType}}
{{/isListContainer}}
{{#isMapContainer}}
cJSON *{{{name}}} = cJSON_AddObjectToObject(item, "{{{baseName}}}");
if ({{{name}}} == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
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;
{{#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}}
{{#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 = OpenAPI_{{complexType}}_convertToJSON(localKeyValue->value);
if (itemLocal == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
cJSON_AddItemToObject({{{name}}}, localKeyValue->key, itemLocal);
{{/isPrimitiveType}}
}
}
{{/isMapContainer}}
{{/isContainer}}
{{^required}}
}
{{/required}}
{{/vars}}
end:
return item;
}
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON)
{
OpenAPI_{{classname}}_t *{{classname}}_local_var = NULL;
{{#vars}}
cJSON *{{{name}}} = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{baseName}}}");
{{#required}}
if (!{{{name}}}) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/required}}
{{^isContainer}}
{{#isPrimitiveType}}
{{#isEnum}}
OpenAPI_{{classVarName}}_{{name}}_e {{name}}Variable;
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{name}}Variable = OpenAPI_{{name}}{{classname}}_FromString({{{name}}}->valuestring);
{{/isEnum}}
{{^isEnum}}
{{#isNumeric}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsNumber({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isNumeric}}
{{#isBoolean}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsBool({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isBoolean}}
{{#isString}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isString}}
{{/isEnum}}
{{#isByteArray}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsNumber({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isByteArray}}
{{#isBinary}}
OpenAPI_binary_t* decoded_str_{{{name}}} = OpenAPI_malloc(sizeof(OpenAPI_binary_t));
{{^required}}if ({{{name}}}) { {{/required}}
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}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isDate}}
{{#isDateTime}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isDateTime}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{#isEnum}}
OpenAPI_{{complexType}}_e {{name}}Variable;
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{name}}Variable = OpenAPI_{{complexType}}_FromString({{{name}}}->valuestring);
{{/isEnum}}
{{^isEnum}}
{{#isModel}}
{{^isFreeFormObject}}OpenAPI_{{complexType}}{{/isFreeFormObject}}{{#isFreeFormObject}}OpenAPI_object{{/isFreeFormObject}}_t *{{name}}_local_nonprim = NULL;
{{^required}}if ({{{name}}}) { {{/required}}
{{{name}}}_local_nonprim = OpenAPI_{{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_parseFromJSON({{{name}}});
{{/isModel}}
{{#isUuid}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isUuid}}
{{#isEmail}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isEmail}}
{{#isFreeFormObject}}
OpenAPI_object_t *{{name}}_local_object = NULL;
{{^required}}if ({{{name}}}) { {{/required}}
{{{name}}}_local_object = OpenAPI_object_parseFromJSON({{{name}}});
{{/isFreeFormObject}}
{{/isEnum}}
{{/isPrimitiveType}}
{{/isContainer}}
{{#isContainer}}
{{#isListContainer}}
{{#isPrimitiveType}}
{{^isEnum}}
OpenAPI_list_t *{{{name}}}List;
{{^required}}if ({{{name}}}) { {{/required}}
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_or_assert({{{name}}}_local->valuestring));
{{/isString}}
{{#isNumeric}}
if (!cJSON_IsNumber({{{name}}}_local)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
OpenAPI_list_add({{{name}}}List , &{{{name}}}_local->valuedouble);
{{/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}}
}
{{/isEnum}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{^isEnum}}
OpenAPI_list_t *{{{name}}}List;
{{^required}}if ({{{name}}}) { {{/required}}
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)) {
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, {{#isEnum}}{{#items}}(void *){{/items}}{{/isEnum}}{{{name}}}Item);
}
{{/isEnum}}
{{#isEnum}}
OpenAPI_list_t *{{{name}}}List;
{{^required}}if ({{{name}}}) { {{/required}}
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_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}}
{{/isPrimitiveType}}
{{/isListContainer}}
{{#isMapContainer}}
OpenAPI_list_t *{{{name}}}List;
{{^required}}if ({{{name}}}) { {{/required}}
cJSON *{{{name}}}_local_map;
if (!cJSON_IsObject({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{{name}}}List = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach({{{name}}}_local_map, {{{name}}}) {
cJSON *localMapObject = {{{name}}}_local_map;
{{#isPrimitiveType}}
{{#isString}}
if (!cJSON_IsString(localMapObject)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
localMapKeyPair = OpenAPI_map_create(ogs_strdup_or_assert(localMapObject->string),ogs_strdup_or_assert(localMapObject->valuestring));
{{/isString}}
{{#isBoolean}}
if (!cJSON_IsBool(localMapObject)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
localMapKeyPair = OpenAPI_map_create(ogs_strdup_or_assert(localMapObject->string), &localMapObject->valueint);
{{/isBoolean}}
{{#isNumeric}}
if (!cJSON_IsNumber(localMapObject)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
localMapKeyPair = OpenAPI_map_create(ogs_strdup_or_assert(localMapObject->string),&localMapObject->valuedouble );
{{/isNumeric}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
if (!cJSON_IsObject({{{name}}}_local_map)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
localMapKeyPair = OpenAPI_map_create(
localMapObject->string, OpenAPI_{{complexType}}_parseFromJSON(localMapObject));
{{/isPrimitiveType}}
OpenAPI_list_add({{{name}}}List , localMapKeyPair);
}
{{/isMapContainer}}
{{/isContainer}}
{{^required}}
}
{{/required}}
{{/vars}}
{{classname}}_local_var = OpenAPI_{{classname}}_create (
{{#vars}}
{{^isContainer}}
{{^isPrimitiveType}}
{{#isEnum}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}Variable{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isEnum}}
{{^isEnum}}
{{#isModel}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isModel}}
{{#isUuid}}
{{^required}}{{{name}}} ? {{/required}}ogs_strdup_or_assert({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isUuid}}
{{#isEmail}}
{{^required}}{{{name}}} ? {{/required}}ogs_strdup_or_assert({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isEmail}}
{{#isFreeFormObject}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_object{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isFreeFormObject}}
{{/isEnum}}
{{/isPrimitiveType}}
{{#isPrimitiveType}}
{{#isEnum}}
{{^required}}{{{name}}} ? {{/required}}{{name}}Variable{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isEnum}}
{{^isEnum}}
{{#isNumeric}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valuedouble{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isNumeric}}
{{#isBoolean}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isBoolean}}
{{#isString}}
{{^required}}{{{name}}} ? {{/required}}ogs_strdup_or_assert({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isString}}
{{/isEnum}}
{{#isByteArray}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isByteArray}}
{{#isBinary}}
{{^required}}{{{name}}} ? {{/required}}decoded_str_{{{name}}}{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isBinary}}
{{#isDate}}
{{^required}}{{{name}}} ? {{/required}}ogs_strdup_or_assert({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isDate}}
{{#isDateTime}}
{{^required}}{{{name}}} ? {{/required}}ogs_strdup_or_assert({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isDateTime}}
{{/isPrimitiveType}}
{{/isContainer}}
{{#isContainer}}
{{#isListContainer}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isListContainer}}
{{#isMapContainer}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isMapContainer}}
{{/isContainer}}
{{/vars}}
);
return {{classname}}_local_var;
end:
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}}

View file

@ -1,182 +0,0 @@
{{#models}}{{#model}}/*
* {{classname}}.h
*
* {{description}}
*/
#ifndef _OpenAPI_{{classname}}_H_
#define _OpenAPI_{{classname}}_H_
#include <string.h>
#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}}
{{#isUuid}}
{{datatype}} *{{name}};
{{/isUuid}}
{{#isEmail}}
{{datatype}} *{{name}};
{{/isEmail}}
{{#isFreeFormObject}}
OpenAPI_{{datatype}}_t *{{name}};
{{/isFreeFormObject}}
{{/isEnum}}
{{/isPrimitiveType}}
{{#isPrimitiveType}}
{{#isEnum}}
OpenAPI_{{classVarName}}_{{name}}_e {{name}};
{{/isEnum}}
{{^isEnum}}
{{#isNumeric}}
{{datatype}} {{name}};
{{/isNumeric}}
{{#isBoolean}}
{{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}}
{{#isListContainer}}
OpenAPI_{{datatype}}_t *{{name}};
{{/isListContainer}}
{{#isMapContainer}}
OpenAPI_{{datatype}} {{name}};
{{/isMapContainer}}
{{/isContainer}}
{{/vars}}
} OpenAPI_{{classname}}_t;
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_create(
{{#vars}}
{{^isContainer}}
{{^isPrimitiveType}}
{{#isEnum}}
OpenAPI_{{datatype}}_e {{name}}{{#hasMore}},{{/hasMore}}
{{/isEnum}}
{{^isEnum}}
{{#isModel}}
OpenAPI_{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isModel}}
{{#isUuid}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isUuid}}
{{#isEmail}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isEmail}}
{{#isFreeFormObject}}
OpenAPI_{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isFreeFormObject}}
{{/isEnum}}
{{/isPrimitiveType}}
{{#isPrimitiveType}}
{{#isEnum}}
OpenAPI_{{classVarName}}_{{name}}_e {{name}}{{#hasMore}},{{/hasMore}}
{{/isEnum}}
{{^isEnum}}
{{#isNumeric}}
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isNumeric}}
{{#isBoolean}}
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isBoolean}}
{{#isString}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isString}}
{{/isEnum}}
{{#isByteArray}}
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isByteArray}}
{{#isBinary}}
OpenAPI_{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isBinary}}
{{#isDate}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isDate}}
{{#isDateTime}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isDateTime}}
{{/isPrimitiveType}}
{{/isContainer}}
{{#isContainer}}
{{#isListContainer}}
OpenAPI_{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isListContainer}}
{{#isMapContainer}}
OpenAPI_{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isMapContainer}}
{{/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}}

View file

@ -1,36 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "object.h"
OpenAPI_object_t *OpenAPI_object_create(void)
{
OpenAPI_object_t *object = ogs_malloc(sizeof(OpenAPI_object_t));
ogs_assert(object);
return object;
}
void OpenAPI_object_free(OpenAPI_object_t *object)
{
ogs_free (object);
}
cJSON *OpenAPI_object_convertToJSON(OpenAPI_object_t *object)
{
cJSON *item = cJSON_CreateObject();
return item;
fail:
cJSON_Delete(item);
return NULL;
}
OpenAPI_object_t *OpenAPI_object_parseFromJSON(cJSON *objectJSON)
{
OpenAPI_object_t *object = NULL;
return object;
end:
return NULL;
}

View file

@ -1,30 +0,0 @@
#ifndef OGS_SBI_OBJECT_H
#define OGS_SBI_OBJECT_H
#include <string.h>
#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 *objectJSON);
cJSON *OpenAPI_object_convertToJSON(OpenAPI_object_t *object);
#ifdef __cplusplus
}
#endif
#endif /* OGS_SBI_OBJECT_H */

File diff suppressed because it is too large Load diff