Skip to content

Commit 473a203

Browse files
committed
improved test case
1 parent 6d9ef28 commit 473a203

7 files changed

Lines changed: 49 additions & 3 deletions

File tree

src/testInt/groovy/com/github/hauner/openapi/processor/ProcessorEndToEndTest.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class ProcessorEndToEndTest extends ProcessorTestBase {
4848
'response-content-single',
4949
'response-result-mapping',
5050
'response-simple-data-types',
51+
'response-single-multi-mapping',
5152
'schema-composed'
5253
]
5354

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class ProcessorPendingTest extends ProcessorTestBase {
2828
@Parameterized.Parameters(name = "{0}")
2929
static Collection<TestSet> sources () {
3030
return [
31-
new TestSet(name: 'response-single', parser: ParserType.SWAGGER),
32-
new TestSet(name: 'response-single', parser: ParserType.OPENAPI4J)
31+
new TestSet(name: 'response-single-multi-mapping', parser: ParserType.SWAGGER),
32+
new TestSet(name: 'response-single-multi-mapping', parser: ParserType.OPENAPI4J)
3333
]
3434
}
3535

src/testInt/resources/response-single/generated/api/Api.java renamed to src/testInt/resources/response-single-multi-mapping/generated/api/Api.java

File renamed without changes.
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-spring.
3+
* DO NOT EDIT.
4+
*/
5+
6+
package generated.model;
7+
8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
10+
public class Author {
11+
12+
@JsonProperty("name")
13+
private String name;
14+
15+
public String getName() {
16+
return name;
17+
}
18+
19+
public void setName(String name) {
20+
this.name = name;
21+
}
22+
23+
}

src/testInt/resources/response-single/generated/model/Book.java renamed to src/testInt/resources/response-single-multi-mapping/generated/model/Book.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ public class Book {
1515
@JsonProperty("title")
1616
private String title;
1717

18+
@JsonProperty("authors")
19+
private Author[] authors;
20+
1821
public String getIsbn() {
1922
return isbn;
2023
}
@@ -31,4 +34,12 @@ public void setTitle(String title) {
3134
this.title = title;
3235
}
3336

37+
public Author[] getAuthors() {
38+
return authors;
39+
}
40+
41+
public void setAuthors(Author[] authors) {
42+
this.authors = authors;
43+
}
44+
3445
}

src/testInt/resources/response-single/mapping.yaml renamed to src/testInt/resources/response-single-multi-mapping/mapping.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ map:
77
- from: single
88
to: reactor.core.publisher.Mono
99

10-
- from: array
10+
- from: multi
1111
to: reactor.core.publisher.Flux

src/testInt/resources/response-single/openapi.yaml renamed to src/testInt/resources/response-single-multi-mapping/openapi.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,14 @@ components:
7777
type: string
7878
title:
7979
type: string
80+
authors:
81+
type: array
82+
items:
83+
$ref: '#/components/schemas/Author'
84+
85+
Author:
86+
type: object
87+
properties:
88+
name:
89+
type: string
90+

0 commit comments

Comments
 (0)