File tree Expand file tree Collapse file tree 2 files changed +69
-2
lines changed
modules/swagger-parser-v3/src/test
java/io/swagger/v3/parser/util Expand file tree Collapse file tree 2 files changed +69
-2
lines changed Original file line number Diff line number Diff line change @@ -1337,4 +1337,17 @@ public void testArbitraryObjectModelWithArrayInlineWithTitle() {
1337
1337
ObjectSchema op = (ObjectSchema ) inlineProp ;
1338
1338
assertNull (op .getProperties ());
1339
1339
}
1340
- }
1340
+
1341
+
1342
+ @ Test (description = "https://github.com/swagger-api/swagger-parser/issues/1200" )
1343
+ public void testInlineItemsSchema () throws Exception {
1344
+ ParseOptions options = new ParseOptions ();
1345
+ options .setFlatten (true );
1346
+ OpenAPI openAPI = new OpenAPIV3Parser ().read ("flatten.json" ,null , options );
1347
+
1348
+ System .out .println (openAPI );
1349
+
1350
+ assertNotNull (openAPI );
1351
+ assertNotNull (openAPI .getComponents ().getSchemas ().get ("inline_response_200" ));
1352
+ }
1353
+ }
Original file line number Diff line number Diff line change 1
1
{
2
2
"openapi" : " 3.0.1" ,
3
+ "paths" : {
4
+ "/employees" : {
5
+ "get" : {
6
+ "description" : " Obtain information about employees from HR database" ,
7
+ "parameters" : [ {
8
+ "name" : " bodylimit" ,
9
+ "in" : " query" ,
10
+ "schema" : {
11
+ "type" : " integer" ,
12
+ "minimum" : 10 ,
13
+ "maximum" : 20 ,
14
+ "example" : 8
15
+ }
16
+ }, {
17
+ "name" : " pagelimit" ,
18
+ "in" : " query" ,
19
+ "schema" : {
20
+ "type" : " integer" ,
21
+ "minimum" : 1 ,
22
+ "maximum" : 5 ,
23
+ "example" : 2
24
+ }
25
+ } ],
26
+ "responses" : {
27
+ "200" : {
28
+ "description" : " successully returned number of employees" ,
29
+ "content" : {
30
+ "application/json" : {
31
+ "schema" : {
32
+ "type" : " array" ,
33
+ "items" : {
34
+ "properties" : {
35
+ "id" : {
36
+ "type" : " integer" ,
37
+ "example" : 4
38
+ },
39
+ "employee name" : {
40
+ "type" : " string" ,
41
+ "example" : " vijay"
42
+ },
43
+ "employee title" : {
44
+ "type" : " string" ,
45
+ "example" : " QA"
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ },
3
57
"components" : {
4
58
"schemas" : {
5
59
"ReturnInformation" : {
47
101
}
48
102
}
49
103
}
50
- }
104
+ }
You can’t perform that action at this time.
0 commit comments