I could not find the exact APIs to extract the resource/operation details linked to external file via $ref as like the one you have mentioned in your previous email.
I can only able to get the operations that are defined in the same document.
I followed the com.wordnik.swagger.models.Path class to extract the operations defined on this path.
Is there any other way to look up and extract the linked resource details?
Below is my code snippet that I used in my application:
Map<String, Path> paths = swagger.getPaths();
Set<Entry<String, Path>> entrySet = paths.entrySet();
for (Entry<String, Path> entry : entrySet) {
String pathId = entry.getKey();
Path path = entry.getValue();
System.out.println("\t Resource path : " + pathId);
Operation getOperation = path.getGet();
if (getOperation != null) {
System.out.println("\t \t Method Type : GET");
printOperationDetails(getOperation);
}
Operation postOperation = path.getPost();
if (postOperation != null) {
System.out.println("\t \t Method Type : POST");
printOperationDetails(postOperation);
}
Operation putOperation = path.getPut();
if (putOperation != null) {
System.out.println("\t \t Method Type : PUT");
printOperationDetails(putOperation);
}
Operation deleteOperation = path.getDelete();
if (deleteOperation != null) {
System.out.println("\t \t Method Type : DELETE");
printOperationDetails(deleteOperation);
}
}