Merge branch 'empty_classes' of https://github.com/bbdouglas/swagger-codegen into bbdouglas-empty_classes

This commit is contained in:
wing328
2017-05-16 17:51:42 +08:00
304 changed files with 23359 additions and 295 deletions

View File

@@ -4,6 +4,7 @@ import java.math.BigDecimal;
import io.swagger.model.Client;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import io.swagger.model.OuterComposite;
import io.swagger.annotations.*;
import org.springframework.http.ResponseEntity;
@@ -23,6 +24,42 @@ import javax.validation.Valid;
@Api(value = "fake", description = "the fake API")
public interface FakeApi {
@ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) })
@RequestMapping(value = "/fake/outer/boolean",
method = RequestMethod.POST)
ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body);
@ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) })
@RequestMapping(value = "/fake/outer/composite",
method = RequestMethod.POST)
ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body);
@ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) })
@RequestMapping(value = "/fake/outer/number",
method = RequestMethod.POST)
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body);
@ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Output string", response = String.class) })
@RequestMapping(value = "/fake/outer/string",
method = RequestMethod.POST)
ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body);
@ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake", })
@ApiResponses(value = {
@ApiResponse(code = 200, message = "successful operation", response = Client.class) })

View File

@@ -4,6 +4,7 @@ import java.math.BigDecimal;
import io.swagger.model.Client;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import io.swagger.model.OuterComposite;
import io.swagger.annotations.*;
@@ -27,6 +28,26 @@ public class FakeApiController implements FakeApi {
public ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
// do some magic!
return new ResponseEntity<Boolean>(HttpStatus.OK);
}
public ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) {
// do some magic!
return new ResponseEntity<OuterComposite>(HttpStatus.OK);
}
public ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
// do some magic!
return new ResponseEntity<BigDecimal>(HttpStatus.OK);
}
public ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
// do some magic!
return new ResponseEntity<String>(HttpStatus.OK);
}
public ResponseEntity<Client> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client body) {
// do some magic!
return new ResponseEntity<Client>(HttpStatus.OK);

View File

@@ -0,0 +1,121 @@
package io.swagger.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import javax.validation.constraints.*;
/**
* OuterComposite
*/
public class OuterComposite {
@JsonProperty("my_number")
private BigDecimal myNumber = null;
@JsonProperty("my_string")
private String myString = null;
@JsonProperty("my_boolean")
private Boolean myBoolean = null;
public OuterComposite myNumber(BigDecimal myNumber) {
this.myNumber = myNumber;
return this;
}
/**
* Get myNumber
* @return myNumber
**/
@ApiModelProperty(value = "")
public BigDecimal getMyNumber() {
return myNumber;
}
public void setMyNumber(BigDecimal myNumber) {
this.myNumber = myNumber;
}
public OuterComposite myString(String myString) {
this.myString = myString;
return this;
}
/**
* Get myString
* @return myString
**/
@ApiModelProperty(value = "")
public String getMyString() {
return myString;
}
public void setMyString(String myString) {
this.myString = myString;
}
public OuterComposite myBoolean(Boolean myBoolean) {
this.myBoolean = myBoolean;
return this;
}
/**
* Get myBoolean
* @return myBoolean
**/
@ApiModelProperty(value = "")
public Boolean getMyBoolean() {
return myBoolean;
}
public void setMyBoolean(Boolean myBoolean) {
this.myBoolean = myBoolean;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OuterComposite outerComposite = (OuterComposite) o;
return Objects.equals(this.myNumber, outerComposite.myNumber) &&
Objects.equals(this.myString, outerComposite.myString) &&
Objects.equals(this.myBoolean, outerComposite.myBoolean);
}
@Override
public int hashCode() {
return Objects.hash(myNumber, myString, myBoolean);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OuterComposite {\n");
sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n");
sb.append(" myString: ").append(toIndentedString(myString)).append("\n");
sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}