diff --git a/src/main/java/com/endava/cats/model/factory/FuzzingDataFactory.java b/src/main/java/com/endava/cats/model/factory/FuzzingDataFactory.java index 19962cb74..2545ed79d 100644 --- a/src/main/java/com/endava/cats/model/factory/FuzzingDataFactory.java +++ b/src/main/java/com/endava/cats/model/factory/FuzzingDataFactory.java @@ -441,7 +441,12 @@ private String extractResponseSchemaRef(Operation operation, String responseCode return apiResponse.get$ref(); } if (apiResponse.getContent() != null && apiResponse.getContent().get(MimeTypeUtils.APPLICATION_JSON_VALUE) != null) { - return apiResponse.getContent().get(MimeTypeUtils.APPLICATION_JSON_VALUE).getSchema().get$ref(); + Schema respSchema = apiResponse.getContent().get(MimeTypeUtils.APPLICATION_JSON_VALUE).getSchema(); + if (respSchema instanceof ArraySchema) { + return ((ArraySchema) respSchema).getItems().get$ref(); + } else { + return respSchema.get$ref(); + } } return null; }