File tree Expand file tree Collapse file tree 2 files changed +93
-0
lines changed
modules/swagger-parser-v3/src/test
java/io/swagger/v3/parser/test Expand file tree Collapse file tree 2 files changed +93
-0
lines changed Original file line number Diff line number Diff line change @@ -492,6 +492,17 @@ public void testIssue85(@Injectable final List<AuthorizationValue> auths) {
492
492
assertTrue (prop instanceof Schema );
493
493
}
494
494
495
+ @ Test
496
+ public void testIssue1352 (@ Injectable final List <AuthorizationValue > auths ) {
497
+ ParseOptions options = new ParseOptions ();
498
+ options .setResolve (true );
499
+ options .setResolveFully (true );
500
+
501
+ OpenAPI openAPI = new OpenAPIV3Parser ().readLocation ("issue-1352.json" , auths , options ).getOpenAPI ();
502
+ assertNull (openAPI .getPaths ().get ("/responses" ).getPatch ().getResponses ().get ("200" ).getHeaders ().get ("x-my-secret-header" ).getSchema ().get$ref ());
503
+
504
+ }
505
+
495
506
@ Test
496
507
public void testIssue1157 (@ Injectable final List <AuthorizationValue > auths ) {
497
508
ParseOptions options = new ParseOptions ();
Original file line number Diff line number Diff line change
1
+ {
2
+ "openapi" : " 3.0.0" ,
3
+ "info" : {
4
+ "title" : " Responses" ,
5
+ "version" : " 0.0.0"
6
+ },
7
+ "paths" : {
8
+ "/responses" : {
9
+ "patch" : {
10
+ "responses" : {
11
+ "200" : {
12
+ "description" : " It's a secret" ,
13
+ "headers" : {
14
+ "x-my-secret-header" : {
15
+ "required" : true ,
16
+ "schema" : {
17
+ "$ref" : " #/components/schemas/secrets"
18
+ }
19
+ }
20
+ },
21
+ "content" : {
22
+ "application/json" : {
23
+ "schema" : {
24
+ "type" : " object" ,
25
+ "maxProperties" : 1 ,
26
+ "additionalProperties" : {
27
+ "type" : " number"
28
+ }
29
+ }
30
+ },
31
+ "text/javascript" : {
32
+ "schema" : {
33
+ "type" : " object" ,
34
+ "minProperties" : 1 ,
35
+ "additionalProperties" : {
36
+ "type" : " boolean"
37
+ }
38
+ }
39
+ }
40
+ }
41
+ },
42
+ "4XX" : {
43
+ "$ref" : " #/components/responses/failure"
44
+ }
45
+ }
46
+ }
47
+ }
48
+ },
49
+ "components" : {
50
+ "responses" : {
51
+ "success" : {
52
+ "description" : " Success" ,
53
+ "content" : {
54
+ "application/json" : {
55
+ "schema" : {
56
+ "$ref" : " #/components/schemas/successContent"
57
+ }
58
+ }
59
+ }
60
+ },
61
+ "failure" : {
62
+ "description" : " Error" ,
63
+ "content" : {
64
+ "application/json" : {
65
+ "schema" : {
66
+ "type" : " object"
67
+ }
68
+ }
69
+ }
70
+ }
71
+ },
72
+ "schemas" : {
73
+ "secrets" : {
74
+ "type" : " array" ,
75
+ "items" : {
76
+ "type" : " integer" ,
77
+ "format" : " int64"
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
You can’t perform that action at this time.
0 commit comments