File tree Expand file tree Collapse file tree
openapi-processor-core/src/testInt/resources/tests/map-from-additional-properties-with-package-name Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ items :
2+ - generated/api/Api.java
3+ - generated/model/Value.java
Original file line number Diff line number Diff line change 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 number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ items :
2+ - inputs/openapi30.yaml
3+ - inputs/openapi31.yaml
4+ - inputs/mapping.yaml
Original file line number Diff line number Diff line change 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 number Diff line number Diff line change 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 number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments