Skip to content

Commit efd2232

Browse files
authored
Update PathProcessor
improve validation in resolving path references
1 parent 2de0106 commit efd2232

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/processors/PathsProcessor.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,9 @@ protected boolean isLocalRef(String ref) {
279279
}
280280

281281
protected boolean isAbsoluteRef(String ref) {
282-
if(ref.startsWith("./")) {
282+
if(!ref.startsWith(".")) {
283283
return true;
284-
}
284+
}
285285
return false;
286286
}
287287

@@ -292,6 +292,9 @@ protected String computeRef(String ref, String prefix) {
292292
}
293293

294294
protected String computeRelativeRef(String ref, String prefix) {
295+
if(ref.startsWith("./")) {
296+
return ref;
297+
}
295298
int iIdxOfSlash = prefix.lastIndexOf('/');
296299
if(iIdxOfSlash != -1) {
297300
return prefix.substring(0, iIdxOfSlash+1) + ref;

0 commit comments

Comments
 (0)