File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
modules/swagger-parser-v2-converter/src/test
java/io/swagger/parser/test Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ public class V2ConverterTest {
90
90
private static final String ISSUE_768_JSON = "issue-786.json" ;
91
91
private static final String ISSUE_820_YAML = "issue-820.yaml" ;
92
92
private static final String ISSUE_1032_YAML = "issue-1032.yaml" ;
93
+ private static final String ISSUE_1113_YAML = "issue-1113.yaml" ;
93
94
94
95
private static final String API_BATCH_PATH = "/api/batch/" ;
95
96
private static final String PETS_PATH = "/pets" ;
@@ -779,6 +780,16 @@ public void testIssue1032() throws Exception {
779
780
assertEquals (INTEGER_TYPE , integerSchema .getType ());
780
781
assertEquals (INT64_FORMAT , integerSchema .getFormat ());
781
782
}
783
+
784
+ @ Test (description = "OpenAPI v2 converter - parses URL correctly when no schemas are present" )
785
+ public void testIssue1113 () throws Exception {
786
+ final OpenAPI oas = getConvertedOpenAPIFromJsonFile (ISSUE_1113_YAML );
787
+ assertNotNull (oas );
788
+ assertNotNull (oas .getServers ());
789
+ assertFalse (oas .getServers ().isEmpty ());
790
+ assertNotNull (oas .getServers ().get (0 ));
791
+ assertEquals (oas .getServers ().get (0 ).getUrl (), "/test" );
792
+ }
782
793
783
794
private OpenAPI getConvertedOpenAPIFromJsonFile (String file ) throws IOException , URISyntaxException {
784
795
SwaggerConverter converter = new SwaggerConverter ();
Original file line number Diff line number Diff line change
1
+ swagger : ' 2.0'
2
+ info :
3
+ title : Test for Issue 1113
4
+ version : 1.0.0
5
+ basePath : /test
6
+ paths :
7
+ /ping :
8
+ get :
9
+ summary : test
10
+ description : ' test'
11
+ operationId : pingOp
12
+ responses :
13
+ ' 200 ' :
14
+ description : OK
You can’t perform that action at this time.
0 commit comments