@@ -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 ();
@@ -498,6 +492,8 @@ public void testResolveFully() throws Exception{
498492 assertEquals (result .getOpenAPI ().getComponents ().getSchemas ().get ("OrderRef" ).getType (),"object" );
499493 }
500494
495+
496+
501497 @ Test
502498 public void testResolveEmpty (@ Injectable final List <AuthorizationValue > auths ) throws Exception {
503499 String pathFile = FileUtils .readFileToString (new File ("src/test/resources/empty-oas.yaml" ));
@@ -512,12 +508,9 @@ public void testResolveEmpty(@Injectable final List<AuthorizationValue> auths) t
512508
513509 @ Test
514510 public void testResolveFullyExample () throws Exception {
515-
516-
517511 String pathFile = FileUtils .readFileToString (new File ("src/test/resources/oas3.yaml.template" ));
518512 pathFile = pathFile .replace ("${dynamicPort}" , String .valueOf (this .serverPort ));
519513 ParseOptions options = new ParseOptions ();
520- //options.setResolve(true);
521514 options .setResolveFully (true );
522515
523516 SwaggerParseResult result = new OpenAPIV3Parser ().readContents (pathFile , new ArrayList <>(), options );
@@ -558,8 +551,25 @@ public void testInlineModelResolver(@Injectable final List<AuthorizationValue> a
558551 }
559552
560553 @ Test
561- public void test30NoOptions (@ Injectable final List <AuthorizationValue > auths ) throws Exception {
554+ public void testRemotePathItemIssue1103 (@ Injectable final List <AuthorizationValue > auths ) throws Exception {
555+ OpenAPI result = new OpenAPIV3Parser ().read ("issue-1103/remote-pathItem-swagger.yaml" );
556+ Assert .assertNotNull (result );
557+ Assert .assertNotNull (result .getPaths ().get ("/Translation/{lang}" ));
558+ Assert .assertEquals (result .getPaths ().get ("/Translation/{lang}" ).getPut ().getParameters ().get (0 ).getName (), "lang" );
559+ }
560+
562561
562+
563+ @ Test
564+ public void testRemoteParameterIssue1103 (@ Injectable final List <AuthorizationValue > auths ) throws Exception {
565+ OpenAPI result = new OpenAPIV3Parser ().read ("issue-1103/remote-parameter-swagger.yaml" );
566+ Assert .assertNotNull (result );
567+ Assert .assertEquals (result .getPaths ().get ("/Translation/{lang}" ).getPut ().getParameters ().get (0 ).getName (), "lang" );
568+
569+ }
570+
571+ @ Test
572+ public void test30NoOptions (@ Injectable final List <AuthorizationValue > auths ) throws Exception {
563573 String pathFile = FileUtils .readFileToString (new File ("src/test/resources/oas3.yaml.template" ));
564574 pathFile = pathFile .replace ("${dynamicPort}" , String .valueOf (this .serverPort ));
565575
@@ -573,7 +583,6 @@ public void test30NoOptions(@Injectable final List<AuthorizationValue> auths) th
573583
574584 @ Test
575585 public void testShellMethod (@ Injectable final List <AuthorizationValue > auths ){
576-
577586 String url = "http://localhost:${dynamicPort}/remote/spec" ;
578587 url = url .replace ("${dynamicPort}" , String .valueOf (this .serverPort ));
579588
@@ -584,7 +593,6 @@ public void testShellMethod(@Injectable final List<AuthorizationValue> auths){
584593
585594 @ Test
586595 public void testInlineModelResolverByUrl (){
587-
588596 String url = "http://localhost:${dynamicPort}/remote/json" ;
589597 url = url .replace ("${dynamicPort}" , String .valueOf (this .serverPort ));
590598
@@ -665,7 +673,6 @@ public void testComposedSchemaAdjacent(@Injectable final List<AuthorizationValue
665673 OpenAPI openAPI = new OpenAPIV3Parser ().read ("src/test/resources/composedSchemaRef.yaml" , auths , options );
666674
667675 Assert .assertNotNull (openAPI );
668-
669676 Assert .assertTrue (openAPI .getComponents ().getSchemas ().size () == 5 );
670677 Schema schema = openAPI .getPaths ().get ("/path" ).getGet ().getResponses ().get ("200" ).getContent ().get ("application/json" ).getSchema ();
671678 Assert .assertTrue (schema instanceof ComposedSchema );
@@ -708,9 +715,7 @@ public void testRefPaths() throws Exception {
708715 " $ref: '#/paths/~1foo'" ;
709716
710717 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
711-
712718 OpenAPI openAPI = (parser .readContents (yaml ,null ,null )).getOpenAPI ();
713-
714719 assertEquals (openAPI .getPaths ().get ("foo" ),openAPI .getPaths ().get ("foo2" ));
715720
716721
@@ -738,7 +743,6 @@ public void testModelParameters() throws Exception {
738743 " description: ok" ;
739744
740745 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
741-
742746 OpenAPI openAPI = (parser .readContents (yaml ,null ,null )).getOpenAPI ();
743747
744748 }
@@ -886,7 +890,6 @@ public void testUniqueParameters() throws Exception {
886890 @ Test
887891 public void testLoadRelativeFileTree_Json () throws Exception {
888892 final OpenAPI openAPI = doRelativeFileTest ("src/test/resources/relative-file-references/json/parent.json" );
889- //Json.mapper().writerWithDefaultPrettyPrinter().writeValue(new File("resolved.json"), openAPI);
890893 }
891894
892895 @ Test
@@ -999,7 +1002,6 @@ public void testIssue75() {
9991002
10001003 assertNotNull (model );
10011004 assertTrue (model instanceof ArraySchema );
1002-
10031005 ArraySchema am = (ArraySchema ) model ;
10041006 assertTrue (am .getItems () instanceof ByteArraySchema );
10051007 assertEquals (am .getItems ().getFormat (), "byte" );
@@ -1009,7 +1011,6 @@ public void testIssue75() {
10091011 public void testIssue62 () {
10101012 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
10111013 final OpenAPI openAPI = parser .read ("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/fixtures/v2.0/json/resources/resourceWithLinkedDefinitions.json" );
1012-
10131014 assertNotNull (openAPI .getPaths ().get ("/pets/{petId}" ).getGet ());
10141015 }
10151016
@@ -1028,7 +1029,6 @@ public void testParameterRequired() {
10281029 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
10291030 final OpenAPI openAPI = parser .read ("src/test/resources/petstore.yaml" );
10301031 final List <Parameter > operationParams = openAPI .getPaths ().get ("/pet/{petId}" ).getPost ().getParameters ();
1031-
10321032 final PathParameter pathParameter = (PathParameter ) operationParams .get (0 );
10331033 Assert .assertTrue (pathParameter .getRequired ());
10341034 }
@@ -1037,7 +1037,6 @@ public void testParameterRequired() {
10371037 public void testIssue108 () {
10381038 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
10391039 final OpenAPI openAPI = parser .read ("src/test/resources/issue_108.yaml" );
1040-
10411040 assertNotNull (openAPI );
10421041 }
10431042
@@ -1106,15 +1105,13 @@ public void testIssue292WithCSVCollectionFormat() {
11061105 @ Test
11071106 public void testIssue255 () {
11081107 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
1109-
11101108 OpenAPI openAPI = parser .read ("objectExample.yaml" );
11111109 assertEquals (openAPI .getComponents ().getSchemas ().get ("SamplePayload" ).getExample ().toString (), "[{\" op\" :\" replace\" ,\" path\" :\" /s\" ,\" v\" :\" w\" }]" );
11121110 }
11131111
11141112 @ Test
11151113 public void testIssue286 () {
11161114 OpenAPIV3Parser parser = new OpenAPIV3Parser ();
1117-
11181115 OpenAPI openAPI = parser .read ("issue_286.yaml" );
11191116 Schema response = openAPI .getPaths ().get ("/" ).getGet ().getResponses ().get ("200" ).getContent ().get ("*/*" ).getSchema ();
11201117 assertTrue (response .get$ref () != null );
@@ -1160,15 +1157,10 @@ public void testIssue360() {
11601157
11611158 assertEquals (sbpModel .getType (), "string" );
11621159 assertEquals (sbpModel .getFormat (), "uuid" );
1163-
11641160 RequestBody bodyParameter = openAPI .getPaths ().get ("/evenMorePets" ).getPost ().getRequestBody ();
1165-
11661161 assertTrue (bodyParameter .getRequired ());
1167-
11681162 Schema refModel = bodyParameter .getContent ().get ("application/json" ).getSchema ();
11691163 assertTrue (refModel .get$ref () != null );
1170-
1171-
11721164 assertEquals (refModel .get$ref (), "#/components/schemas/Pet" );
11731165 }
11741166
@@ -1182,10 +1174,7 @@ private OpenAPI doRelativeFileTest(String location) {
11821174 Json .prettyPrint (readResult .getMessages ());
11831175 }
11841176 final OpenAPI openAPI = readResult .getOpenAPI ();
1185-
1186-
11871177 final PathItem path = openAPI .getPaths ().get ("/health" );
1188-
11891178 assertEquals (path .getClass (), PathItem .class ); //we successfully converted the RefPath to a Path
11901179
11911180 final List <Parameter > parameters = path .getParameters ();
@@ -1197,7 +1186,6 @@ private OpenAPI doRelativeFileTest(String location) {
11971186 assertParamDetails (operationParams , 0 , PathParameter .class , "param3" , "path" );
11981187 assertParamDetails (operationParams , 1 , HeaderParameter .class , "param4" , "header" );
11991188
1200-
12011189 final Map <String , ApiResponse > responsesMap = operation .getResponses ();
12021190
12031191 assertResponse (openAPI , responsesMap , "200" ,"application/json" , "Health information from the server" , "#/components/schemas/health" );
0 commit comments