Skip to content

Commit 3f831fd

Browse files
committed
#24, integration test
(cherry picked from commit 5dc9536)
1 parent 437d5b9 commit 3f831fd

7 files changed

Lines changed: 170 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
items:
2+
- generated/api/Api.java
3+
- generated/model/Value.java
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package generated.api;
2+
3+
import annotation.Mapping;
4+
import generated.model.Value;
5+
import generated.support.Generated;
6+
import java.util.List;
7+
import java.util.Map;
8+
9+
@Generated(value = "openapi-processor-core", version = "test")
10+
public interface Api {
11+
12+
/**
13+
* query object dictionary
14+
*
15+
* @return dictionary response
16+
*/
17+
@Mapping("/values")
18+
Map<String, Value> getValues();
19+
20+
/**
21+
* query object dictionary
22+
*
23+
* @return dictionary response
24+
*/
25+
@Mapping("/multi-values")
26+
Map<String, List<Value>> getMultiValues();
27+
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package generated.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import generated.support.Generated;
5+
6+
@Generated(value = "openapi-processor-core", version = "test")
7+
public class Value {
8+
9+
@JsonProperty("text")
10+
private String text;
11+
12+
public String getText() {
13+
return text;
14+
}
15+
16+
public void setText(String text) {
17+
this.text = text;
18+
}
19+
20+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
items:
2+
- inputs/openapi30.yaml
3+
- inputs/openapi31.yaml
4+
- inputs/mapping.yaml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
openapi-processor-mapping: v3
2+
3+
options:
4+
generated-date: false
5+
package-name: generated
6+
bean-validation: javax
7+
javadoc: true
8+
9+
map:
10+
types:
11+
- type: array => java.util.List
12+
- type: Values => java.util.Map<java.lang.String, {package-name}.model.Value>>
13+
- type: MultiValues => java.util.Map<java.lang.String, java.util.List<{package-name}.model.Value>>>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
openapi: 3.0.3
2+
info:
3+
title: test API
4+
version: 1.0.0
5+
6+
paths:
7+
8+
/values:
9+
get:
10+
description: query object dictionary
11+
responses:
12+
'200':
13+
description: dictionary response
14+
content:
15+
application/json:
16+
schema:
17+
$ref: '#/components/schemas/Values'
18+
19+
/multi-values:
20+
get:
21+
description: query object dictionary
22+
responses:
23+
'200':
24+
description: dictionary response
25+
content:
26+
application/json:
27+
schema:
28+
$ref: '#/components/schemas/MultiValues'
29+
30+
components:
31+
schemas:
32+
33+
Values:
34+
description: key is string, value is a Value object
35+
type: object
36+
additionalProperties:
37+
$ref: '#/components/schemas/Value'
38+
39+
MultiValues:
40+
description: key is string, value is a Value array
41+
type: object
42+
additionalProperties:
43+
type: array
44+
items:
45+
$ref: '#/components/schemas/Value'
46+
47+
Value:
48+
type: object
49+
properties:
50+
text:
51+
type: string
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
openapi: 3.1.0
2+
info:
3+
title: test API
4+
version: 1.0.0
5+
6+
paths:
7+
8+
/values:
9+
get:
10+
description: query object dictionary
11+
responses:
12+
'200':
13+
description: dictionary response
14+
content:
15+
application/json:
16+
schema:
17+
$ref: '#/components/schemas/Values'
18+
19+
/multi-values:
20+
get:
21+
description: query object dictionary
22+
responses:
23+
'200':
24+
description: dictionary response
25+
content:
26+
application/json:
27+
schema:
28+
$ref: '#/components/schemas/MultiValues'
29+
30+
components:
31+
schemas:
32+
33+
Values:
34+
description: key is string, value is a Value object
35+
type: object
36+
additionalProperties:
37+
$ref: '#/components/schemas/Value'
38+
39+
MultiValues:
40+
description: key is string, value is a Value array
41+
type: object
42+
additionalProperties:
43+
type: array
44+
items:
45+
$ref: '#/components/schemas/Value'
46+
47+
Value:
48+
type: object
49+
properties:
50+
text:
51+
type: string

0 commit comments

Comments
 (0)