File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
modules/swagger-parser-v3/src
main/java/io/swagger/v3/parser/util
test/java/io/swagger/v3/parser/util Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,9 @@ public void process(URLConnection connection) {
94
94
public static String cleanUrl (String url ) {
95
95
String result = null ;
96
96
try {
97
- result =url .replaceAll ("\\ {" , "%7B" ).replaceAll ("\\ }" , "%7D" );
97
+ result =url .replaceAll ("\\ {" , "%7B" ).
98
+ replaceAll ("\\ }" , "%7D" ).
99
+ replaceAll (" " , "%20" );
98
100
}catch (Exception t ){
99
101
t .printStackTrace ();
100
102
}
Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ public void setUp() throws Exception {
43
43
public void testCleanUrl () {
44
44
String cleaned = RemoteUrl .cleanUrl ("http://foo/bar/com/{v2}/fun" );
45
45
assertEquals (cleaned , "http://foo/bar/com/%7Bv2%7D/fun" );
46
+
47
+ cleaned = RemoteUrl .cleanUrl ("http://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/export?DocumentFormat=Swagger&ApiName=Face API - V1.0" );
48
+ assertEquals (cleaned , "http://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/export?DocumentFormat=Swagger&ApiName=Face%20API%20-%20V1.0" );
46
49
}
47
50
48
51
@ Test
You can’t perform that action at this time.
0 commit comments