@@ -16,8 +16,7 @@ class RefSpec: StringSpec({
16
16
17
17
" parses ref into another file" {
18
18
val api = ApiBuilder ()
19
- .withResource("/v30/ref-into-another-file/openapi.yaml")
20
- .buildOpenApi30()
19
+ .buildOpenApi30("/v30/ref-into-another-file/openapi.yaml")
21
20
22
21
val schema = api.getResponseSchema("/foo", "200", "application/json")
23
22
schema.ref shouldBe " foo.yaml#/Foo"
@@ -30,8 +29,7 @@ class RefSpec: StringSpec({
30
29
31
30
" parses ref array items with nested ref" {
32
31
val api = ApiBuilder ()
33
- .withResource("/v30/ref-array-items-nested/openapi.yaml")
34
- .buildOpenApi30()
32
+ .buildOpenApi30("/v30/ref-array-items-nested/openapi.yaml")
35
33
36
34
val schema = api.getResponseSchema("/array", "200", "application/json")
37
35
schema.type shouldBe " array"
@@ -54,8 +52,7 @@ class RefSpec: StringSpec({
54
52
55
53
" parses ref loop" {
56
54
val api = ApiBuilder ()
57
- .withResource("/v30/ref-loop/openapi.yaml")
58
- .buildOpenApi30()
55
+ .buildOpenApi30("/v30/ref-loop/openapi.yaml")
59
56
60
57
val schema = api.getResponseSchema("/self-reference", "200", "application/json")
61
58
schema.ref shouldBe " #/components/schemas/Self"
@@ -73,8 +70,7 @@ class RefSpec: StringSpec({
73
70
74
71
" parses array ref items with nested array and ref items loop" {
75
72
val api = ApiBuilder ()
76
- .withResource("/v30/ref-loop-array/openapi.yaml")
77
- .buildOpenApi30()
73
+ .buildOpenApi30("/v30/ref-loop-array/openapi.yaml")
78
74
79
75
val schema = api.getResponseSchema("/response-ref", "200", "application/json")
80
76
@@ -115,8 +111,7 @@ class RefSpec: StringSpec({
115
111
116
112
" parses ref in parameter" {
117
113
val api = ApiBuilder ()
118
- .withResource("/v30/ref-parameter/openapi.yaml")
119
- .buildOpenApi30()
114
+ .buildOpenApi30("/v30/ref-parameter/openapi.yaml")
120
115
121
116
val parameters = api.getParameters("/foo")
122
117
parameters.size shouldBe 1
@@ -131,8 +126,7 @@ class RefSpec: StringSpec({
131
126
132
127
" parses ref relative to current file" {
133
128
val api = ApiBuilder ()
134
- .withResource("/v30/ref-is-relative-to-current-file/openapi.yaml")
135
- .buildOpenApi30()
129
+ .buildOpenApi30("/v30/ref-is-relative-to-current-file/openapi.yaml")
136
130
137
131
val schema = api.getResponseSchema("/foo", "200", "application/json")
138
132
schema.ref shouldBe " schemas/foo.yaml#/Foo"
@@ -151,8 +145,7 @@ class RefSpec: StringSpec({
151
145
152
146
" parses ref into another file without pointer" {
153
147
val api = ApiBuilder ()
154
- .withResource("/v30/ref-into-another-file-path/openapi.yaml")
155
- .buildOpenApi30()
148
+ .buildOpenApi30("/v30/ref-into-another-file-path/openapi.yaml")
156
149
157
150
val paths = api.paths
158
151
val pathItem = paths.getPathItem("/foo")
@@ -169,8 +162,7 @@ class RefSpec: StringSpec({
169
162
170
163
" parses ~ escaped ref path into another file" {
171
164
val api = ApiBuilder ()
172
- .withResource("/v30/ref-to-escaped-path-name/openapi.yaml")
173
- .buildOpenApi30()
165
+ .buildOpenApi30("/v30/ref-to-escaped-path-name/openapi.yaml")
174
166
175
167
val paths = api.paths
176
168
0 commit comments