[SBI] Ignore unknown enum values and continue parsing (#2622) (#2649)

* [SBI] Ignore unknown enum values and continue parsing (#2622)

* [SBI] Reject empty enum lists (#2622)

Enum lists that are empty due to ignoring
unsupported enum values are also rejected.

* Revert changing `generator.sh`
This commit is contained in:
Brias 2023-10-26 15:44:51 +02:00 committed by GitHub
parent e3c2fd00d9
commit 3c6811a322
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
72 changed files with 978 additions and 366 deletions

View file

@ -263,10 +263,15 @@ OpenAPI_sec_negotiate_req_data_t *OpenAPI_sec_negotiate_req_data_parseFromJSON(c
}
localEnum = OpenAPI_security_capability_FromString(supported_sec_capability_list_local->valuestring);
if (!localEnum) {
ogs_error("OpenAPI_security_capability_FromString(supported_sec_capability_list_local->valuestring) failed");
goto end;
ogs_info("Enum value \"%s\" for field \"supported_sec_capability_list\" is not supported. Ignoring it ...",
supported_sec_capability_list_local->valuestring);
} else {
OpenAPI_list_add(supported_sec_capability_listList, (void *)localEnum);
}
OpenAPI_list_add(supported_sec_capability_listList, (void *)localEnum);
}
if (supported_sec_capability_listList->count == 0) {
ogs_error("OpenAPI_sec_negotiate_req_data_parseFromJSON() failed: Expected supported_sec_capability_listList to not be empty (after ignoring unsupported enum values).");
goto end;
}
_3_gpp_sbi_target_api_root_supported = cJSON_GetObjectItemCaseSensitive(sec_negotiate_req_dataJSON, "3GppSbiTargetApiRootSupported");