Skip to content

Commit 13dbc0a

Browse files
authored
Merge pull request #10201 from swagger-api/issues-10185
Issues 10185
2 parents 74cc5c0 + af02488 commit 13dbc0a

File tree

10 files changed

+91
-11
lines changed

10 files changed

+91
-11
lines changed

modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public interface {{classname}} {
101101
produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}{{#hasConsumes}}
102102
consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}{{/singleContentTypes}}
103103
method = RequestMethod.{{httpMethod}})
104-
{{#defaultInterfaces}}default {{/defaultInterfaces}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}){{^defaultInterfaces}};{{/defaultInterfaces}}{{#defaultInterfaces}} {
104+
{{#jdk8}}{{#defaultInterfaces}}default {{/defaultInterfaces}}{{/jdk8}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}){{^jdk8}};{{/jdk8}}{{#jdk8}}{{#defaultInterfaces}} {
105105
{{#delegate-method}}
106106
return {{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
107107
}
@@ -129,7 +129,7 @@ public interface {{classname}} {
129129
{{#isDelegate}}
130130
return getDelegate().{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
131131
{{/isDelegate}}
132-
}{{/defaultInterfaces}}
132+
}{{/defaultInterfaces}}{{/jdk8}}
133133

134134
{{/operation}}
135135
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.10-SNAPSHOT
1+
2.4.14-SNAPSHOT

samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT).
2+
* NOTE: This class is auto generated by the swagger code generator program (2.4.14-SNAPSHOT).
33
* https://github.com/swagger-api/swagger-codegen
44
* Do not edit the class manually.
55
*/

samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT).
2+
* NOTE: This class is auto generated by the swagger code generator program (2.4.14-SNAPSHOT).
33
* https://github.com/swagger-api/swagger-codegen
44
* Do not edit the class manually.
55
*/

samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT).
2+
* NOTE: This class is auto generated by the swagger code generator program (2.4.14-SNAPSHOT).
33
* https://github.com/swagger-api/swagger-codegen
44
* Do not edit the class manually.
55
*/

samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT).
2+
* NOTE: This class is auto generated by the swagger code generator program (2.4.14-SNAPSHOT).
33
* https://github.com/swagger-api/swagger-codegen
44
* Do not edit the class manually.
55
*/
@@ -144,6 +144,6 @@ public interface PetApi {
144144
produces = { "application/json" },
145145
consumes = { "multipart/form-data" },
146146
method = RequestMethod.POST)
147-
ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file);
147+
ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file);
148148

149149
}

samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApiController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public ResponseEntity<Void> updatePetWithForm(@ApiParam(value = "ID of pet that
127127
return new ResponseEntity<Void>(HttpStatus.NOT_IMPLEMENTED);
128128
}
129129

130-
public ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) {
130+
public ResponseEntity<ModelApiResponse> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file) {
131131
String accept = request.getHeader("Accept");
132132
if (accept != null && accept.contains("application/json")) {
133133
try {

samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT).
2+
* NOTE: This class is auto generated by the swagger code generator program (2.4.14-SNAPSHOT).
33
* https://github.com/swagger-api/swagger-codegen
44
* Do not edit the class manually.
55
*/

samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT).
2+
* NOTE: This class is auto generated by the swagger code generator program (2.4.14-SNAPSHOT).
33
* https://github.com/swagger-api/swagger-codegen
44
* Do not edit the class manually.
55
*/
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
package io.swagger.model;
2+
3+
import java.util.Objects;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
5+
import com.fasterxml.jackson.annotation.JsonCreator;
6+
import io.swagger.annotations.ApiModel;
7+
import io.swagger.annotations.ApiModelProperty;
8+
import org.springframework.validation.annotation.Validated;
9+
import javax.validation.Valid;
10+
import javax.validation.constraints.*;
11+
12+
/**
13+
* List
14+
*/
15+
@Validated
16+
17+
public class List {
18+
@JsonProperty("123-list")
19+
private String _123List = null;
20+
21+
public List _123List(String _123List) {
22+
this._123List = _123List;
23+
return this;
24+
}
25+
26+
/**
27+
* Get _123List
28+
* @return _123List
29+
**/
30+
@ApiModelProperty(value = "")
31+
32+
33+
public String get123List() {
34+
return _123List;
35+
}
36+
37+
public void set123List(String _123List) {
38+
this._123List = _123List;
39+
}
40+
41+
42+
@Override
43+
public boolean equals(java.lang.Object o) {
44+
if (this == o) {
45+
return true;
46+
}
47+
if (o == null || getClass() != o.getClass()) {
48+
return false;
49+
}
50+
List list = (List) o;
51+
return Objects.equals(this._123List, list._123List);
52+
}
53+
54+
@Override
55+
public int hashCode() {
56+
return Objects.hash(_123List);
57+
}
58+
59+
@Override
60+
public String toString() {
61+
StringBuilder sb = new StringBuilder();
62+
sb.append("class List {\n");
63+
64+
sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n");
65+
sb.append("}");
66+
return sb.toString();
67+
}
68+
69+
/**
70+
* Convert the given object to string with each line indented by 4 spaces
71+
* (except the first line).
72+
*/
73+
private String toIndentedString(java.lang.Object o) {
74+
if (o == null) {
75+
return "null";
76+
}
77+
return o.toString().replace("\n", "\n ");
78+
}
79+
}
80+

0 commit comments

Comments
 (0)