File tree Expand file tree Collapse file tree
groovy/com/github/hauner/openapi/generatr
resources/params-complex-data-types Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ class GeneratrEndToEndTest extends GeneratrTestBase {
4242 new TestSet (name : ' response-complex-data-types' ),
4343 new TestSet (name : ' response-simple-data-types' ),
4444 new TestSet (name : ' params-simple-data-types' ),
45+ new TestSet (name : ' params-complex-data-types' )
4546 ]
4647 }
4748
Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ class GeneratrPendingTest extends GeneratrTestBase {
2727 @Parameterized.Parameters (name = " {0}" )
2828 static Collection<TestSet > sources () {
2929 return [
30- // new TestSet(name: 'params-complex-data-types') // todo
31- new TestSet (name : ' params-additional' )
30+ new TestSet (name : ' params-complex-data-types' )
3231 ]
3332 }
3433
Original file line number Diff line number Diff line change 55
66package generated .api ;
77
8+ import generated .model .Props ;
89import org .springframework .http .ResponseEntity ;
910import org .springframework .web .bind .annotation .GetMapping ;
10- import org .springframework .web .bind .annotation .RequestParam ;
1111
12- public interface EndpointApi {
12+ public interface Api {
1313
1414 @ GetMapping (path = "/endpoint-object" )
15- ResponseEntity <Void > getEndpointObject (@ RequestParam Props props );
16-
17- @ GetMapping (path = "/endpoint-map" )
18- ResponseEntity <Void > getEndpointMap (@ RequestParam (name = "props" ) Map props );
15+ ResponseEntity <Void > getEndpointObject (Props props );
1916
2017}
Original file line number Diff line number Diff line change @@ -7,108 +7,28 @@ paths:
77
88 /endpoint-object :
99 get :
10- tags :
11- - endpoint
10+ description : <
11+ should be mapped to a `Props` pojo without `@RequestParam` annotation
1212 parameters :
1313 - name : props
14- description : query, not required, object
14+ description : query parameter object
1515 in : query
1616 required : false
17+ explode : true
1718 schema :
1819 $ref : ' #/components/schemas/Props'
1920 responses :
2021 ' 204 ' :
2122 description : empty
2223
23- /endpoint-map :
24- get :
25- tags :
26- - endpoint
27- parameters :
28- - name : props
29- description : query, not required, map from single property
30- in : query
31- required : false
32- schema :
33- $ref : ' #/components/schemas/SinglePropMap'
34- responses :
35- ' 204 ' :
36- description : empty
37-
38- # /endpoint-map-all:
39- # get:
40- # tags:
41- # - endpoint
42- # parameters:
43- # - name: props
44- # description: query, not required, map from all properties
45- # in: query
46- # required: false
47- # schema:
48- # $ref: '#/components/schemas/Props'
49- # x-java-type: java.util.Map<String, String>
50- # responses:
51- # '204':
52- # description: empty
53- #
54- # /endpoint-multimap:
55- # get:
56- # tags:
57- # - endpoint
58- # parameters:
59- # - name: props
60- # description: query, not required, map from all properties
61- # in: query
62- # required: false
63- # schema:
64- # $ref: '#/components/schemas/Props'
65- # x-java-type: org.springframework.util.MultiValueMap<String,String>
66- # responses:
67- # '204':
68- # description: empty
69-
7024components :
7125
7226 schemas :
7327
7428 Props :
7529 type : object
76- properties :
77- prop1 :
78- type : string
79- default : " 1"
80- prop2 :
81- type : string
82- default : " 2"
83-
84- SinglePropMap :
85- type : object
86- x-java-type : java.util.Map
8730 properties :
8831 prop1 :
8932 type : string
9033 prop2 :
9134 type : string
92-
93- # PropsMap:
94- # type: object
95- # x-java-type: java.util.Map<String>
96- # properties:
97- # prop1:
98- # type: string
99- # prop2:
100- # type: string
101-
102- #
103- # MultiPropsMap:
104- # type: object
105- # x-java-type: org.springframework.util.MultiValueMap<String,String>
106- # properties:
107- # prop1:
108- # type: array
109- # items:
110- # type: string
111- # prop2:
112- # type: array
113- # items:
114- # type: string
You can’t perform that action at this time.
0 commit comments