Skip to content

Commit 0ad630e

Browse files
committed
new test case
1 parent 723b193 commit 0ad630e

File tree

7 files changed

+117
-4
lines changed

7 files changed

+117
-4
lines changed

openapi-processor-core/src/testInt/groovy/com/github/hauner/openapi/processor/core/ProcessorPendingTest.groovy

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ class ProcessorPendingTest extends ProcessorTestBase {
3232
@Parameterized.Parameters(name = "{0}")
3333
static Collection<TestSet> sources () {
3434
return [
35-
new TestSet(name: 'params-request-body-multipart-form-data', processor: new TestProcessor(), parser: ParserType.SWAGGER),
36-
37-
// new TestSet(name: 'ref-into-another-file-path', processor: new TestProcessor(), parser: ParserType.SWAGGER),
38-
// new TestSet(name: 'ref-into-another-file-path', processor: new TestProcessor(), parser: ParserType.OPENAPI4J)
35+
new TestSet(name: 'ref-array-items-nested', processor: new TestProcessor(), parser: ParserType.OPENAPI4J),
36+
new TestSet(name: 'ref-array-items-nested', processor: new TestProcessor(), parser: ParserType.SWAGGER)
3937
]
4038
}
4139

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
items:
2+
- generated/api/Api.java
3+
- generated/model/Bar.java
4+
- generated/model/Foo.java
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* This class is auto generated by https://github.com/hauner/openapi-processor-core.
3+
* TEST ONLY.
4+
*/
5+
6+
package generated.api;
7+
8+
import annotation.Mapping;
9+
import generated.model.Bar;
10+
11+
public interface Api {
12+
13+
@Mapping("/array")
14+
Bar[] getArray();
15+
16+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* This class is auto generated by https://github.com/hauner/openapi-processor-core.
3+
* TEST ONLY.
4+
*/
5+
6+
package generated.model;
7+
8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
10+
public class Bar {
11+
12+
@JsonProperty("bar")
13+
private String bar;
14+
15+
@JsonProperty("foos")
16+
private Foo[] foos;
17+
18+
public String getBar() {
19+
return bar;
20+
}
21+
22+
public void setBar(String bar) {
23+
this.bar = bar;
24+
}
25+
26+
public Foo[] getFoos() {
27+
return foos;
28+
}
29+
30+
public void setFoos(Foo[] foos) {
31+
this.foos = foos;
32+
}
33+
34+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* This class is auto generated by https://github.com/hauner/openapi-processor-core.
3+
* TEST ONLY.
4+
*/
5+
6+
package generated.model;
7+
8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
10+
public class Foo {
11+
12+
@JsonProperty("foo")
13+
private String foo;
14+
15+
public String getFoo() {
16+
return foo;
17+
}
18+
19+
public void setFoo(String foo) {
20+
this.foo = foo;
21+
}
22+
23+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
items:
2+
- inputs/openapi.yaml
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
openapi: 3.0.3
2+
info:
3+
title: array with item ref
4+
version: 1.0.0
5+
6+
paths:
7+
/array:
8+
get:
9+
responses:
10+
'200':
11+
description: bar
12+
content:
13+
application/json:
14+
schema:
15+
type: array
16+
items:
17+
$ref: '#/components/schemas/Bar'
18+
19+
components:
20+
schemas:
21+
22+
Foo:
23+
type: object
24+
properties:
25+
foo:
26+
type: string
27+
28+
Bar:
29+
type: object
30+
properties:
31+
bar:
32+
type: string
33+
foos:
34+
type: array
35+
items:
36+
$ref: '#/components/schemas/Foo'

0 commit comments

Comments
 (0)