better npe in processUseAllOfRefAsParent (openapi normalizer) (#15224)

This commit is contained in:
William Cheng 2023-04-15 15:54:54 +08:00 committed by GitHub
parent c5a8fafc3d
commit 9ad695d52c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -514,6 +514,10 @@ public class OpenAPINormalizer {
return; return;
} }
if (schema.getAllOf() == null) {
return;
}
for (Object item : schema.getAllOf()) { for (Object item : schema.getAllOf()) {
if (!(item instanceof Schema)) { if (!(item instanceof Schema)) {
throw new RuntimeException("Error! allOf schema is not of the type Schema: " + item); throw new RuntimeException("Error! allOf schema is not of the type Schema: " + item);