This repository was archived by the owner on Nov 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
modules/swagger-parser-v3/src/test
java/io/swagger/v3/parser/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,6 +65,20 @@ public class OpenAPIV3ParserTest {
6565 protected int serverPort = getDynamicPort ();
6666 protected WireMockServer wireMockServer ;
6767
68+ @ Test
69+ public void testIssue1071 () {
70+
71+ ParseOptions options = new ParseOptions ();
72+ options .setResolve (true );
73+
74+ SwaggerParseResult parseResult = new OpenAPIV3Parser ().readLocation ("issue-1071.yaml" , null , options );
75+ OpenAPI apispec = parseResult .getOpenAPI ();
76+ assertNotNull (apispec );
77+ Schema test = apispec .getPaths ().get ("/mapschema" ).getGet ().getResponses ().get ("200" ).getContent ().get ("application/json" ).getSchema ();
78+ System .out .println (test .getClass ());
79+ assertTrue (test instanceof MapSchema );
80+
81+ }
6882
6983 @ Test
7084 public void testIssue1039 () {
@@ -76,7 +90,7 @@ public void testIssue1039() {
7690 OpenAPI apispec = parseResult .getOpenAPI ();
7791 assertNotNull (apispec );
7892 assertEquals (apispec .getPaths ().get ("/pets" ).getGet ().getParameters ().get (0 ).getSchema ().getType (),"array" );
79-
93+
8094 }
8195
8296 @ Test
Original file line number Diff line number Diff line change 1+ openapi : " 3.0.0"
2+ info :
3+ version : 1.0.0
4+ title : Swagger Petstore
5+ description : A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification
6+ termsOfService : http://swagger.io/terms/
7+ contact :
8+ name : Swagger API Team
9+ email : apiteam@swagger.io
10+ url : http://swagger.io
11+ license :
12+ name : Apache 2.0
13+ url : https://www.apache.org/licenses/LICENSE-2.0.html
14+ servers :
15+ - url : http://petstore.swagger.io/api
16+ paths :
17+ ' /mapschema ' :
18+ get :
19+ description : MapSchema
20+ operationId : MapSchema
21+ responses :
22+ ' 200 ' :
23+ description : Successful response.
24+ content :
25+ application/json :
26+ schema :
27+ type : object
28+ additionalProperties :
29+ type : string
You can’t perform that action at this time.
0 commit comments