fix the logic. when ref is specified the exact don't join relative path.
@@ -672,9 +672,11 @@ public final class ExternalRefProcessor {
processRefToExternalSchema(externalFile + subRef.get$ref(), RefFormat.RELATIVE);
return;
}
- String $ref = constructRef(subRef, externalFile);
+ String $ref = subRef.get$ref();
+ if (format.equals(RefFormat.RELATIVE)) {
+ $ref = constructRef(subRef, externalFile);
subRef.set$ref($ref);
-
+ }
processRefToExternalSchema($ref, computeRefFormat(subRef.get$ref()));
}
@@ -684,6 +686,7 @@ public final class ExternalRefProcessor {
return join(rootLocation, ref);
}
+ // visible for testing
public static String join(String source, String fragment) {
try {
boolean isRelative = false;
