[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

@ -586,10 +586,15 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
}
localEnum = OpenAPI_rat_type_FromString(rat_type_local->valuestring);
if (!localEnum) {
ogs_error("OpenAPI_rat_type_FromString(rat_type_local->valuestring) failed");
goto end;
ogs_info("Enum value \"%s\" for field \"rat_type\" is not supported. Ignoring it ...",
rat_type_local->valuestring);
} else {
OpenAPI_list_add(rat_typeList, (void *)localEnum);
}
OpenAPI_list_add(rat_typeList, (void *)localEnum);
}
if (rat_typeList->count == 0) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed: Expected rat_typeList to not be empty (after ignoring unsupported enum values).");
goto end;
}
}