Skip to content

Commit bf64e99

Browse files
committed
Fix path slash
1 parent 9ed248b commit bf64e99

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/com/apiflows/parser/source/OperationBinder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void bind(OpenAPIWorkflow openAPIWorkflow, String location) {
3636
operations.addAll(getOperations(source.getUrl()));
3737
} else {
3838
// relative path
39-
String filename = getRootFolder(location) + "/" + source.getUrl();
39+
String filename = getRootFolder(location) + source.getUrl();
4040
operations.addAll(getOperations(filename));
4141
}
4242
}
@@ -135,13 +135,13 @@ Operation findOperationByRef(String operationRef, List<Operation> operations) {
135135

136136
String getRootFolder(String location) {
137137
if(location == null) {
138-
return ".";
138+
return "";
139139
} else if(isUrl(location)) {
140-
return location.substring(0, location.lastIndexOf("/") + 1);
140+
return location.substring(0, location.lastIndexOf("/") + 1) + "/";
141141
} else {
142142
Path filePath = Paths.get(location);
143143

144-
return (filePath.getParent() != null ? filePath.getParent().toString() : null);
144+
return (filePath.getParent() != null ? filePath.getParent().toString() + "/" : null);
145145
}
146146
}
147147

0 commit comments

Comments
 (0)