File tree Expand file tree Collapse file tree 1 file changed +55
-1
lines changed
modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test Expand file tree Collapse file tree 1 file changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -657,6 +657,60 @@ public void testIssue85() {
657657 assertTrue (prop instanceof Schema );
658658 }
659659
660+ @ Test
661+ void testIssue2211 () {
662+ // given
663+ String yaml =
664+ " openapi: 3.0.3\n " +
665+ " info:\n " +
666+ " title: technical-definitions\n " +
667+ " description: Commons technical definitions\n " +
668+ " version: 1.0.0\n " +
669+ " paths:\n " +
670+ " /components/parameter:\n " +
671+ " get:\n " +
672+ " tags:\n " +
673+ " - example\n " +
674+ " operationId: getExampleById4\n " +
675+ " parameters:\n " +
676+ " - $ref: '#/components/parameters/Parameter'\n " +
677+ " responses:\n " +
678+ " '200':\n " +
679+ " description: Successful response\n " +
680+ " content:\n " +
681+ " application/json:\n " +
682+ " schema:\n " +
683+ " type: object\n " +
684+ " properties:\n " +
685+ " message:\n " +
686+ " type: string\n " +
687+ " example: Success\n " +
688+ " components:\n " +
689+ " parameters:\n " +
690+ " Parameter:\n " +
691+ " name: id\n " +
692+ " in: query\n " +
693+ " description: The ID of the example to retrieve\n " +
694+ " required: true\n " +
695+ " style: form\n " +
696+ " explode: true\n " +
697+ " schema:\n " +
698+ " type: string\n " +
699+ "\n " ;
700+
701+ ParseOptions options = new ParseOptions ();
702+ options .setResolve (true );
703+
704+ // when
705+ SwaggerParseResult parseResult = new OpenAPIV3Parser ().readContents (yaml , auths , options );
706+
707+ OpenAPI openAPI = parseResult .getOpenAPI ();
708+
709+ // then
710+ assertNotNull (openAPI );
711+ assertEquals (openAPI .getPaths ().get ("/components/parameter" ).getGet ().getParameters ().get (0 ).get$ref (), "#/components/parameters/Parameter" );
712+ }
713+
660714 @ Test
661715 public void testIssue1352 () {
662716 ParseOptions options = new ParseOptions ();
@@ -1500,5 +1554,5 @@ public Object[][] explicitObjectSchemaProvider() {
15001554 { false }
15011555 };
15021556 }
1503-
1557+
15041558}
You can’t perform that action at this time.
0 commit comments