Skip to content

Commit c3b1830

Browse files
authored
Merge pull request #60 from hauner/#58
resolves #58
2 parents 119bbd4 + 03539a4 commit c3b1830

9 files changed

Lines changed: 30 additions & 30 deletions

File tree

docs/generatr/parameter-query.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ will generate the following interface method:
3030
3131
```java
3232
@GetMapping(path = "/endpoint")
33-
ResponseEntity<void> getEndpoint(@RequestParam(name = "foo", required = false, defaultValue = "not set") String foo);
33+
ResponseEntity<Void> getEndpoint(@RequestParam(name = "foo", required = false, defaultValue = "not set") String foo);
3434
```

src/main/groovy/com/github/hauner/openapi/spring/model/datatypes/NoneDataType.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019 the original authors
2+
* Copyright 2019-2020 the original authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ class NoneDataType implements DataType {
2525

2626
@Override
2727
String getName () {
28-
'void'
28+
'Void'
2929
}
3030

3131
@Override

src/test/groovy/com/github/hauner/openapi/spring/writer/MethodWriterSpec.groovy

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class MethodWriterSpec extends Specification {
5555
then:
5656
target.toString () == """\
5757
@GetMapping(path = "${endpoint.path}")
58-
ResponseEntity<void> getPing();
58+
ResponseEntity<Void> getPing();
5959
"""
6060
}
6161

@@ -162,7 +162,7 @@ class MethodWriterSpec extends Specification {
162162
then:
163163
target.toString () == """\
164164
@GetMapping(path = "${endpoint.path}")
165-
ResponseEntity<void> getFoo(@RequestParam(name = "foo") String foo);
165+
ResponseEntity<Void> getFoo(@RequestParam(name = "foo") String foo);
166166
"""
167167
}
168168
@@ -179,7 +179,7 @@ class MethodWriterSpec extends Specification {
179179
then:
180180
target.toString () == """\
181181
@GetMapping(path = "${endpoint.path}")
182-
ResponseEntity<void> getFoo(@RequestParam(name = "foo", required = false) String foo);
182+
ResponseEntity<Void> getFoo(@RequestParam(name = "foo", required = false) String foo);
183183
"""
184184
}
185185
@@ -196,7 +196,7 @@ class MethodWriterSpec extends Specification {
196196
then:
197197
target.toString () == """\
198198
@GetMapping(path = "${endpoint.path}")
199-
ResponseEntity<void> getFoo(@RequestHeader(name = "x-foo") String xFoo);
199+
ResponseEntity<Void> getFoo(@RequestHeader(name = "x-foo") String xFoo);
200200
"""
201201
}
202202
@@ -213,7 +213,7 @@ class MethodWriterSpec extends Specification {
213213
then:
214214
target.toString () == """\
215215
@GetMapping(path = "${endpoint.path}")
216-
ResponseEntity<void> getFoo(@RequestHeader(name = "x-foo", required = false) String xFoo);
216+
ResponseEntity<Void> getFoo(@RequestHeader(name = "x-foo", required = false) String xFoo);
217217
"""
218218
}
219219
@@ -230,7 +230,7 @@ class MethodWriterSpec extends Specification {
230230
then:
231231
target.toString () == """\
232232
@GetMapping(path = "${endpoint.path}")
233-
ResponseEntity<void> getFoo(@CookieValue(name = "foo") String foo);
233+
ResponseEntity<Void> getFoo(@CookieValue(name = "foo") String foo);
234234
"""
235235
}
236236
@@ -247,7 +247,7 @@ class MethodWriterSpec extends Specification {
247247
then:
248248
target.toString () == """\
249249
@GetMapping(path = "${endpoint.path}")
250-
ResponseEntity<void> getFoo(@CookieValue(name = "foo", required = false) String foo);
250+
ResponseEntity<Void> getFoo(@CookieValue(name = "foo", required = false) String foo);
251251
"""
252252
}
253253
@@ -269,7 +269,7 @@ class MethodWriterSpec extends Specification {
269269
then:
270270
target.toString () == """\
271271
@GetMapping(path = "${endpoint.path}")
272-
ResponseEntity<void> getFoo(Foo foo);
272+
ResponseEntity<Void> getFoo(Foo foo);
273273
"""
274274
}
275275
@@ -286,7 +286,7 @@ class MethodWriterSpec extends Specification {
286286
then:
287287
target.toString () == """\
288288
@GetMapping(path = "${endpoint.path}")
289-
ResponseEntity<void> getFoo(@RequestParam(name = "foo") Map foo);
289+
ResponseEntity<Void> getFoo(@RequestParam(name = "foo") Map foo);
290290
"""
291291
}
292292
@@ -303,7 +303,7 @@ class MethodWriterSpec extends Specification {
303303
then:
304304
target.toString () == """\
305305
@GetMapping(path = "${endpoint.path}")
306-
ResponseEntity<void> getFOOooBARrr(@RequestParam(name = "foo") String foo);
306+
ResponseEntity<Void> getFOOooBARrr(@RequestParam(name = "foo") String foo);
307307
"""
308308
}
309309
@@ -320,7 +320,7 @@ class MethodWriterSpec extends Specification {
320320
then:
321321
target.toString () == """\
322322
@GetMapping(path = "${endpoint.path}")
323-
ResponseEntity<void> getFoo(@RequestParam(name = "_fo-o") String foO);
323+
ResponseEntity<Void> getFoo(@RequestParam(name = "_fo-o") String foO);
324324
"""
325325
}
326326
@@ -341,7 +341,7 @@ class MethodWriterSpec extends Specification {
341341
then:
342342
target.toString () == """\
343343
@PostMapping(path = "${endpoint.path}", consumes = {"application/json"})
344-
ResponseEntity<void> postFoo(@RequestBody FooRequestBody body);
344+
ResponseEntity<Void> postFoo(@RequestBody FooRequestBody body);
345345
"""
346346
}
347347
@@ -363,7 +363,7 @@ class MethodWriterSpec extends Specification {
363363
then:
364364
target.toString () == """\
365365
@PostMapping(path = "${endpoint.path}", consumes = {"application/json"})
366-
ResponseEntity<void> postFoo(@RequestBody(required = false) FooRequestBody body);
366+
ResponseEntity<Void> postFoo(@RequestBody(required = false) FooRequestBody body);
367367
"""
368368
}
369369
@@ -382,7 +382,7 @@ class MethodWriterSpec extends Specification {
382382
then:
383383
target.toString () == """\
384384
@GetMapping(path = "${endpoint.path}")
385-
ResponseEntity<void> getFoo(@RequestParam(name = "foo", required = false, defaultValue = "bar") String foo);
385+
ResponseEntity<Void> getFoo(@RequestParam(name = "foo", required = false, defaultValue = "bar") String foo);
386386
"""
387387
}
388388

src/testInt/resources/no-response-content/generated/api/EndpointApi.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
public interface EndpointApi {
1515

1616
@GetMapping(path = "/endpoint")
17-
ResponseEntity<void> getEndpoint();
17+
ResponseEntity<Void> getEndpoint();
1818

1919
@PutMapping(path = "/endpoint")
20-
ResponseEntity<void> putEndpoint();
20+
ResponseEntity<Void> putEndpoint();
2121

2222
@PostMapping(path = "/endpoint")
23-
ResponseEntity<void> postEndpoint();
23+
ResponseEntity<Void> postEndpoint();
2424

2525
@PatchMapping(path = "/endpoint")
26-
ResponseEntity<void> patchEndpoint();
26+
ResponseEntity<Void> patchEndpoint();
2727

2828
}

src/testInt/resources/params-complex-data-types/generated/api/EndpointApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
public interface EndpointApi {
1313

1414
@GetMapping(path = "/endpoint-object")
15-
ResponseEntity<void> getEndpointObject(@RequestParam Props props);
15+
ResponseEntity<Void> getEndpointObject(@RequestParam Props props);
1616

1717
@GetMapping(path = "/endpoint-map")
18-
ResponseEntity<void> getEndpointMap(@RequestParam(name = "props") Map props);
18+
ResponseEntity<Void> getEndpointMap(@RequestParam(name = "props") Map props);
1919

2020
}

src/testInt/resources/params-enum/generated/api/EnumApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
public interface EnumApi {
1515

1616
@GetMapping(path = "/endpoint")
17-
ResponseEntity<void> getEndpoint(@RequestParam(name = "foo") Foo foo, @RequestParam(name = "bar") Bar bar);
17+
ResponseEntity<Void> getEndpoint(@RequestParam(name = "foo") Foo foo, @RequestParam(name = "bar") Bar bar);
1818

1919
}

src/testInt/resources/params-path-simple-data-types/generated/api/EndpointApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
public interface EndpointApi {
1313

1414
@GetMapping(path = "/endpoint/{foo}")
15-
ResponseEntity<void> getEndpointFoo(@PathVariable(name = "foo") String foo);
15+
ResponseEntity<Void> getEndpointFoo(@PathVariable(name = "foo") String foo);
1616

1717
@GetMapping(path = "/endpoint-optional/{foo}")
18-
ResponseEntity<void> getEndpointOptionalFoo(@PathVariable(name = "foo", required = false) String foo);
18+
ResponseEntity<Void> getEndpointOptionalFoo(@PathVariable(name = "foo", required = false) String foo);
1919

2020
}

src/testInt/resources/params-request-body-multipart-form-data/generated/api/Api.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
public interface Api {
1414

1515
@PostMapping(path = "/multipart/single-file")
16-
ResponseEntity<void> postMultipartSingleFile(@RequestParam(name = "file") MultipartFile file, @RequestParam(name = "other") String other);
16+
ResponseEntity<Void> postMultipartSingleFile(@RequestParam(name = "file") MultipartFile file, @RequestParam(name = "other") String other);
1717

1818
@PostMapping(path = "/multipart/multiple-files")
19-
ResponseEntity<void> postMultipartMultipleFiles(@RequestParam(name = "files") MultipartFile[] files, @RequestParam(name = "other") String other);
19+
ResponseEntity<Void> postMultipartMultipleFiles(@RequestParam(name = "files") MultipartFile[] files, @RequestParam(name = "other") String other);
2020

2121
}

src/testInt/resources/params-simple-data-types/generated/api/EndpointApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
public interface EndpointApi {
1313

1414
@GetMapping(path = "/endpoint")
15-
ResponseEntity<void> getEndpoint(@RequestParam(name = "foo") String foo);
15+
ResponseEntity<Void> getEndpoint(@RequestParam(name = "foo") String foo);
1616

1717
@GetMapping(path = "/endpoint-optional")
18-
ResponseEntity<void> getEndpointOptional(@RequestParam(name = "foo", required = false, defaultValue = "bar") String foo);
18+
ResponseEntity<Void> getEndpointOptional(@RequestParam(name = "foo", required = false, defaultValue = "bar") String foo);
1919

2020
}

0 commit comments

Comments
 (0)