@@ -275,8 +275,6 @@ public void testIssue811_RefSchema_ToRefSchema() {
275275
276276 Assert .assertNotNull (openAPI );
277277 Assert .assertEquals (openAPI .getPaths ().get ("/" ).getGet ().getResponses ().get ("200" ).getContent ().get ("application/json" ).getSchema ().get$ref (),"#/components/schemas/schema-with-reference" );
278-
279-
280278 }
281279
282280 @ Test
@@ -286,7 +284,6 @@ public void testIssue811() {
286284 final OpenAPI openAPI = new OpenAPIV3Parser ().readLocation ("oapi-reference-test/index.yaml" , null , options ).getOpenAPI ();
287285
288286 Assert .assertNotNull (openAPI );
289-
290287 Assert .assertEquals (openAPI .getPaths ().get ("/" ).getGet ().getResponses ().get ("200" ).getContent ().get ("application/json" ).getSchema ().get$ref (),"#/components/schemas/schema-with-reference" );
291288
292289 }
@@ -296,7 +293,6 @@ public void testIssue719() {
296293 final OpenAPI openAPI = new OpenAPIV3Parser ().readLocation ("extensions-responses.yaml" , null , new ParseOptions ()).getOpenAPI ();
297294
298295 Assert .assertNotNull (openAPI );
299-
300296 Assert .assertNotNull (openAPI .getPaths ().getExtensions ());
301297 Assert .assertNotNull (openAPI .getPaths ().get ("/something" ).getGet ().getResponses ().getExtensions ());
302298
@@ -483,8 +479,6 @@ public void test30(@Injectable final List<AuthorizationValue> auths) throws Exce
483479
484480 @ Test
485481 public void testResolveFully () throws Exception {
486-
487-
488482 String pathFile = FileUtils .readFileToString (new File ("src/test/resources/oas3.yaml.template" ));
489483 pathFile = pathFile .replace ("${dynamicPort}" , String .valueOf (this .serverPort ));
490484 ParseOptions options = new ParseOptions ();
@@ -514,12 +508,9 @@ public void testResolveEmpty(@Injectable final List<AuthorizationValue> auths) t
514508
515509 @ Test
516510 public void testResolveFullyExample () throws Exception {
517-
518-
519511 String pathFile = FileUtils .readFileToString (new File ("src/test/resources/oas3.yaml.template" ));
520512 pathFile = pathFile .replace ("${dynamicPort}" , String .valueOf (this .serverPort ));
521513 ParseOptions options = new ParseOptions ();
522- //options.setResolve(true);
523514 options .setResolveFully (true );
524515
525516 SwaggerParseResult result = new OpenAPIV3Parser ().readContents (pathFile , new ArrayList <>(), options );
@@ -561,19 +552,16 @@ public void testInlineModelResolver(@Injectable final List<AuthorizationValue> a
561552
562553 @ Test
563554 public void testRemotePathItemIssue1103 (@ Injectable final List <AuthorizationValue > auths ) throws Exception {
564-
565-
566555 OpenAPI result = new OpenAPIV3Parser ().read ("issue-1103/remote-pathItem-swagger.yaml" );
567-
568556 Assert .assertNotNull (result );
569557 Assert .assertNotNull (result .getPaths ().get ("/Translation/{lang}" ));
570558 Assert .assertEquals (result .getPaths ().get ("/Translation/{lang}" ).getPut ().getParameters ().get (0 ).getName (), "lang" );
571559 }
572560
573561
562+
574563 @ Test
575564 public void testRemoteParameterIssue1103 (@ Injectable final List <AuthorizationValue > auths ) throws Exception {
576-
577565 OpenAPI result = new OpenAPIV3Parser ().read ("issue-1103/remote-parameter-swagger.yaml" );
578566 Assert .assertNotNull (result );
579567 Assert .assertEquals (result .getPaths ().get ("/Translation/{lang}" ).getPut ().getParameters ().get (0 ).getName (), "lang" );
@@ -582,7 +570,6 @@ public void testRemoteParameterIssue1103(@Injectable final List<AuthorizationVal
582570
583571 @ Test
584572 public void test30NoOptions (@ Injectable final List <AuthorizationValue > auths ) throws Exception {
585-
586573 String pathFile = FileUtils .readFileToString (new File ("src/test/resources/oas3.yaml.template" ));
587574 pathFile = pathFile .replace ("${dynamicPort}" , String .valueOf (this .serverPort ));
588575
@@ -596,7 +583,6 @@ public void test30NoOptions(@Injectable final List<AuthorizationValue> auths) th
596583
597584 @ Test
598585 public void testShellMethod (@ Injectable final List <AuthorizationValue > auths ){
599-
600586 String url = "http://localhost:${dynamicPort}/remote/spec" ;
601587 url = url .replace ("${dynamicPort}" , String .valueOf (this .serverPort ));
602588
@@ -607,7 +593,6 @@ public void testShellMethod(@Injectable final List<AuthorizationValue> auths){
607593
608594 @ Test
609595 public void testInlineModelResolverByUrl (){
610-
611596 String url = "http://localhost:${dynamicPort}/remote/json" ;
612597 url = url .replace ("${dynamicPort}" , String .valueOf (this .serverPort ));
613598
@@ -631,6 +616,13 @@ public void testInlineModelResolverByUrl(){
631616 assertNotNull (userAddress .getProperties ().get ("street" ));
632617 }
633618
619+ @ Test
620+ public void testIssue1105 () throws Exception {
621+ OpenAPI openAPI = new OpenAPIV3Parser ().read ("issue-1105/swagger-api.yaml" );
622+ Assert .assertNotNull (openAPI );
623+ Assert .assertNotNull (openAPI .getComponents ().getSchemas ().get ("ErrorCodeDescription" ));
624+ }
625+
634626 @ Test
635627 public void testRefAdditionalProperties () throws Exception {
636628 OpenAPI openAPI = new OpenAPIV3Parser ().read ("src/test/resources/relative/additionalProperties.yaml" );
@@ -681,7 +673,6 @@ public void testComposedSchemaAdjacent(@Injectable final List<AuthorizationValue
681673 OpenAPI openAPI = new OpenAPIV3Parser ().read ("src/test/resources/composedSchemaRef.yaml" , auths , options );
682674
683675 Assert .assertNotNull (openAPI );
684-
685676 Assert .assertTrue (openAPI .getComponents ().getSchemas ().size () == 5 );
686677 Schema schema = openAPI .getPaths ().get ("/path" ).getGet ().getResponses ().get ("200" ).getContent ().get ("application/json" ).getSchema ();
687678 Assert .assertTrue (schema instanceof ComposedSchema );
@@ -724,9 +715,7 @@ public void testRefPaths() throws Exception {
724715 " $ref: '#/paths/~1foo'" ;
725716
726717 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
727-
728718 OpenAPI openAPI = (parser .readContents (yaml ,null ,null )).getOpenAPI ();
729-
730719 assertEquals (openAPI .getPaths ().get ("foo" ),openAPI .getPaths ().get ("foo2" ));
731720
732721
@@ -754,7 +743,6 @@ public void testModelParameters() throws Exception {
754743 " description: ok" ;
755744
756745 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
757-
758746 OpenAPI openAPI = (parser .readContents (yaml ,null ,null )).getOpenAPI ();
759747
760748 }
@@ -902,7 +890,6 @@ public void testUniqueParameters() throws Exception {
902890 @ Test
903891 public void testLoadRelativeFileTree_Json () throws Exception {
904892 final OpenAPI openAPI = doRelativeFileTest ("src/test/resources/relative-file-references/json/parent.json" );
905- //Json.mapper().writerWithDefaultPrettyPrinter().writeValue(new File("resolved.json"), openAPI);
906893 }
907894
908895 @ Test
@@ -1015,7 +1002,6 @@ public void testIssue75() {
10151002
10161003 assertNotNull (model );
10171004 assertTrue (model instanceof ArraySchema );
1018-
10191005 ArraySchema am = (ArraySchema ) model ;
10201006 assertTrue (am .getItems () instanceof ByteArraySchema );
10211007 assertEquals (am .getItems ().getFormat (), "byte" );
@@ -1025,7 +1011,6 @@ public void testIssue75() {
10251011 public void testIssue62 () {
10261012 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
10271013 final OpenAPI openAPI = parser .read ("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/fixtures/v2.0/json/resources/resourceWithLinkedDefinitions.json" );
1028-
10291014 assertNotNull (openAPI .getPaths ().get ("/pets/{petId}" ).getGet ());
10301015 }
10311016
@@ -1044,7 +1029,6 @@ public void testParameterRequired() {
10441029 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
10451030 final OpenAPI openAPI = parser .read ("src/test/resources/petstore.yaml" );
10461031 final List <Parameter > operationParams = openAPI .getPaths ().get ("/pet/{petId}" ).getPost ().getParameters ();
1047-
10481032 final PathParameter pathParameter = (PathParameter ) operationParams .get (0 );
10491033 Assert .assertTrue (pathParameter .getRequired ());
10501034 }
@@ -1053,7 +1037,6 @@ public void testParameterRequired() {
10531037 public void testIssue108 () {
10541038 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
10551039 final OpenAPI openAPI = parser .read ("src/test/resources/issue_108.yaml" );
1056-
10571040 assertNotNull (openAPI );
10581041 }
10591042
@@ -1122,15 +1105,13 @@ public void testIssue292WithCSVCollectionFormat() {
11221105 @ Test
11231106 public void testIssue255 () {
11241107 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
1125-
11261108 OpenAPI openAPI = parser .read ("objectExample.yaml" );
11271109 assertEquals (openAPI .getComponents ().getSchemas ().get ("SamplePayload" ).getExample ().toString (), "[{\" op\" :\" replace\" ,\" path\" :\" /s\" ,\" v\" :\" w\" }]" );
11281110 }
11291111
11301112 @ Test
11311113 public void testIssue286 () {
11321114 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
1133-
11341115 OpenAPI openAPI = parser .read ("issue_286.yaml" );
11351116 Schema response = openAPI .getPaths ().get ("/" ).getGet ().getResponses ().get ("200" ).getContent ().get ("*/*" ).getSchema ();
11361117 assertTrue (response .get$ref () != null );
@@ -1176,15 +1157,10 @@ public void testIssue360() {
11761157
11771158 assertEquals (sbpModel .getType (), "string" );
11781159 assertEquals (sbpModel .getFormat (), "uuid" );
1179-
11801160 RequestBody bodyParameter = openAPI .getPaths ().get ("/evenMorePets" ).getPost ().getRequestBody ();
1181-
11821161 assertTrue (bodyParameter .getRequired ());
1183-
11841162 Schema refModel = bodyParameter .getContent ().get ("application/json" ).getSchema ();
11851163 assertTrue (refModel .get$ref () != null );
1186-
1187-
11881164 assertEquals (refModel .get$ref (), "#/components/schemas/Pet" );
11891165 }
11901166
@@ -1198,10 +1174,7 @@ private OpenAPI doRelativeFileTest(String location) {
11981174 Json .prettyPrint (readResult .getMessages ());
11991175 }
12001176 final OpenAPI openAPI = readResult .getOpenAPI ();
1201-
1202-
12031177 final PathItem path = openAPI .getPaths ().get ("/health" );
1204-
12051178 assertEquals (path .getClass (), PathItem .class ); //we successfully converted the RefPath to a Path
12061179
12071180 final List <Parameter > parameters = path .getParameters ();
@@ -1213,7 +1186,6 @@ private OpenAPI doRelativeFileTest(String location) {
12131186 assertParamDetails (operationParams , 0 , PathParameter .class , "param3" , "path" );
12141187 assertParamDetails (operationParams , 1 , HeaderParameter .class , "param4" , "header" );
12151188
1216-
12171189 final Map <String , ApiResponse > responsesMap = operation .getResponses ();
12181190
12191191 assertResponse (openAPI , responsesMap , "200" ,"application/json" , "Health information from the server" , "#/components/schemas/health" );
0 commit comments