private Swagger removeBrokenReferenceDefinitions (Swagger swagger) {
if (swagger.getDefinitions() == null || swagger.getDefinitions().isEmpty()) return swagger;
Set<String> referencedDefinitions = new TreeSet<String>();
if (swagger.getResponses() != null) {
for (Response response: swagger.getResponses().values()) {
<BUG>if (response.getSchema() != null && response.getSchema() instanceof RefProperty) {
referencedDefinitions.add(((RefProperty) response.getSchema()).getSimpleRef());
}</BUG>
}
}

private Swagger removeBrokenReferenceDefinitions (Swagger swagger) {
if (swagger.getDefinitions() == null || swagger.getDefinitions().isEmpty()) return swagger;
Set<String> referencedDefinitions = new TreeSet<String>();
if (swagger.getResponses() != null) {
for (Response response: swagger.getResponses().values()) {
String propertyRef = getPropertyRef(response.getSchema());
if (propertyRef != null) {
referencedDefinitions.add(propertyRef);
}
}
}
