Merge remote-tracking branch 'origin' into 7.0.x

This commit is contained in:
William Cheng
2023-03-03 21:52:50 +08:00
10595 changed files with 418520 additions and 73194 deletions

View File

@@ -15,6 +15,8 @@ src/main/java/org/openapitools/api/StoreApi.java
src/main/java/org/openapitools/api/StoreApiController.java
src/main/java/org/openapitools/api/UserApi.java
src/main/java/org/openapitools/api/UserApiController.java
src/main/java/org/openapitools/api/VersioningApi.java
src/main/java/org/openapitools/api/VersioningApiController.java
src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java
src/main/java/org/openapitools/configuration/HomeController.java
src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java

View File

@@ -11,7 +11,7 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<springfox.version>2.9.2</springfox.version>
<swagger-ui.version>4.10.3</swagger-ui.version>
<swagger-ui.version>4.15.5</swagger-ui.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
@@ -69,7 +69,7 @@
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.2</version>
<version>0.2.6</version>
</dependency>
<!-- Bean Validation API support -->
<dependency>

View File

@@ -6,16 +6,23 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator;
@SpringBootApplication
@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
@SpringBootApplication(
nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class
)
@ComponentScan(
basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"},
nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class
)
public class OpenApiGeneratorApplication {
public static void main(String[] args) {
SpringApplication.run(OpenApiGeneratorApplication.class, args);
}
@Bean
@Bean(name = "org.openapitools.OpenApiGeneratorApplication.jsonNullableModule")
public Module jsonNullableModule() {
return new JsonNullableModule();
}

View File

@@ -24,7 +24,7 @@ import javax.annotation.Generated;
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Api(value = "another-fake", description = "the another-fake API")
@Api(value = "$another-fake?", description = "the $another-fake? API")
public interface AnotherFakeApi {
default Optional<NativeWebRequest> getRequest() {

View File

@@ -395,7 +395,7 @@ public interface FakeApi {
@ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,
@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,
@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,
@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List<String> enumFormStringArray,
@ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List<String> enumFormStringArray,
@ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -413,7 +413,7 @@ public interface FakeApi {
* @param stringGroup String in group parameters (optional)
* @param booleanGroup Boolean in group parameters (optional)
* @param int64Group Integer in group parameters (optional)
* @return Someting wrong (status code 400)
* @return Something wrong (status code 400)
*/
@ApiOperation(
tags = { "fake" },
@@ -422,7 +422,7 @@ public interface FakeApi {
notes = "Fake endpoint to test group parameters (optional)"
)
@ApiResponses({
@ApiResponse(code = 400, message = "Someting wrong")
@ApiResponse(code = 400, message = "Something wrong")
})
@RequestMapping(
method = RequestMethod.DELETE,

View File

@@ -24,7 +24,7 @@ import javax.annotation.Generated;
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Api(value = "fake_classname_test", description = "the fake_classname_test API")
@Api(value = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API")
public interface FakeClassnameTestApi {
default Optional<NativeWebRequest> getRequest() {

View File

@@ -145,12 +145,12 @@ public interface PetApi {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]";
ApiUtil.setExampleResponse(request, "application/json", exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
String exampleString = "<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status> </Pet>";
String exampleString = "<Pet> <id>123456789</id> <Category> <id>123456789</id> <name>aeiou</name> </Category> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> <Tag> <id>123456789</id> <name>aeiou</name> </Tag> </tags> <status>aeiou</status> </Pet>";
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
break;
}
@@ -201,12 +201,12 @@ public interface PetApi {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]";
ApiUtil.setExampleResponse(request, "application/json", exampleString);
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
String exampleString = "<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status> </Pet>";
String exampleString = "<Pet> <id>123456789</id> <Category> <id>123456789</id> <name>aeiou</name> </Category> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> <Tag> <id>123456789</id> <name>aeiou</name> </Tag> </tags> <status>aeiou</status> </Pet>";
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
break;
}
@@ -257,7 +257,7 @@ public interface PetApi {
break;
}
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
String exampleString = "<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status> </Pet>";
String exampleString = "<Pet> <id>123456789</id> <Category> <id>123456789</id> <name>aeiou</name> </Category> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> <Tag> <id>123456789</id> <name>aeiou</name> </Tag> </tags> <status>aeiou</status> </Pet>";
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
break;
}

View File

@@ -97,7 +97,7 @@ public interface StoreApi {
/**
* GET /store/order/{order_id} : Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generate exceptions
*
* @param orderId ID of pet that needs to be fetched (required)
* @return successful operation (status code 200)
@@ -108,7 +108,7 @@ public interface StoreApi {
tags = { "store" },
value = "Find purchase order by ID",
nickname = "getOrderById",
notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions",
response = Order.class
)
@ApiResponses({

View File

@@ -0,0 +1,167 @@
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.api;
import org.openapitools.model.ModelApiResponse;
import io.swagger.annotations.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Generated;
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
@Api(value = "versioning", description = "the versioning API")
public interface VersioningApi {
default Optional<NativeWebRequest> getRequest() {
return Optional.empty();
}
/**
* POST /versioning/headers
*
* @param versionWithDefaultValue (required)
* @param versionNoDefaultValue (required)
* @param petId ID of pet to update (required)
* @return successful operation (status code 200)
*/
@ApiOperation(
tags = { "versioning" },
value = "",
nickname = "versioningHeaders",
notes = "",
response = ModelApiResponse.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
})
@RequestMapping(
method = RequestMethod.POST,
value = "/versioning/headers",
produces = { "*/*" },
headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" }
)
default ResponseEntity<ModelApiResponse> versioningHeaders(
@NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @RequestHeader(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue,
@NotNull @ApiParam(value = "", required = true) @RequestHeader(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue,
@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
ApiUtil.setExampleResponse(request, "*/*", exampleString);
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
/**
* POST /versioning/mix
*
* @param versionWithDefaultValueQuery (required)
* @param versionNoDefaultValueQuery (required)
* @param versionWithDefaultValueHeader (required)
* @param versionNoDefaultValueHeader (required)
* @param petId ID of pet to update (required)
* @return successful operation (status code 200)
*/
@ApiOperation(
tags = { "versioning" },
value = "",
nickname = "versioningMix",
notes = "",
response = ModelApiResponse.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
})
@RequestMapping(
method = RequestMethod.POST,
value = "/versioning/mix",
produces = { "*/*" },
headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } ,
params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" }
)
default ResponseEntity<ModelApiResponse> versioningMix(
@NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery,
@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery,
@NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @RequestHeader(value = "VersionWithDefaultValueHeader", required = true, defaultValue = "V1") String versionWithDefaultValueHeader,
@NotNull @ApiParam(value = "", required = true) @RequestHeader(value = "VersionNoDefaultValueHeader", required = true) String versionNoDefaultValueHeader,
@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
ApiUtil.setExampleResponse(request, "*/*", exampleString);
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
/**
* POST /versioning/query-params
*
* @param versionWithDefaultValue (required)
* @param versionNoDefaultValue (required)
* @param petId ID of pet to update (required)
* @return successful operation (status code 200)
*/
@ApiOperation(
tags = { "versioning" },
value = "",
nickname = "versioningQueryParams",
notes = "",
response = ModelApiResponse.class
)
@ApiResponses({
@ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
})
@RequestMapping(
method = RequestMethod.POST,
value = "/versioning/query-params",
produces = { "*/*" },
params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" }
)
default ResponseEntity<ModelApiResponse> versioningQueryParams(
@NotNull @ApiParam(value = "", required = true, defaultValue = "V1") @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue,
@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue,
@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
ApiUtil.setExampleResponse(request, "*/*", exampleString);
break;
}
}
});
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
}

View File

@@ -0,0 +1,46 @@
package org.openapitools.api;
import org.openapitools.model.ModelApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.context.request.NativeWebRequest;
import javax.validation.constraints.*;
import javax.validation.Valid;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Generated;
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Controller
@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
public class VersioningApiController implements VersioningApi {
private final NativeWebRequest request;
@Autowired
public VersioningApiController(NativeWebRequest request) {
this.request = request;
}
@Override
public Optional<NativeWebRequest> getRequest() {
return Optional.ofNullable(request);
}
}

View File

@@ -10,7 +10,7 @@ import org.springframework.core.convert.converter.Converter;
@Configuration
public class EnumConverterConfiguration {
@Bean
@Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.enumClassConverter")
Converter<String, EnumClass> enumClassConverter() {
return new Converter<String, EnumClass>() {
@Override
@@ -19,7 +19,7 @@ public class EnumConverterConfiguration {
}
};
}
@Bean
@Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumConverter")
Converter<String, OuterEnum> outerEnumConverter() {
return new Converter<String, OuterEnum>() {
@Override

View File

@@ -43,6 +43,22 @@ public class Animal {
@JsonProperty("color")
private String color = "red";
/**
* Default constructor
* @deprecated Use {@link Animal#Animal(String)}
*/
@Deprecated
public Animal() {
super();
}
/**
* Constructor with only required parameters
*/
public Animal(String className) {
this.className = className;
}
public Animal className(String className) {
this.className = className;
return this;

View File

@@ -96,7 +96,7 @@ public class ArrayTest {
return this;
}
public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) {
if (this.arrayArrayOfModel == null) {
this.arrayArrayOfModel = new ArrayList<>();
}

View File

@@ -30,6 +30,22 @@ public class Cat extends Animal {
@JsonProperty("declawed")
private Boolean declawed;
/**
* Default constructor
* @deprecated Use {@link Cat#Cat(String)}
*/
@Deprecated
public Cat() {
super();
}
/**
* Constructor with only required parameters
*/
public Cat(String className) {
super(className);
}
public Cat declawed(Boolean declawed) {
this.declawed = declawed;
return this;

View File

@@ -28,6 +28,22 @@ public class Category {
@JsonProperty("name")
private String name = "default-name";
/**
* Default constructor
* @deprecated Use {@link Category#Category(String)}
*/
@Deprecated
public Category() {
super();
}
/**
* Constructor with only required parameters
*/
public Category(String name) {
this.name = name;
}
public Category id(Long id) {
this.id = id;
return this;

View File

@@ -30,6 +30,22 @@ public class Dog extends Animal {
@JsonProperty("breed")
private String breed;
/**
* Default constructor
* @deprecated Use {@link Dog#Dog(String)}
*/
@Deprecated
public Dog() {
super();
}
/**
* Constructor with only required parameters
*/
public Dog(String className) {
super(className);
}
public Dog breed(String breed) {
this.breed = breed;
return this;

View File

@@ -185,6 +185,22 @@ public class EnumTest {
@JsonProperty("outerEnum")
private OuterEnum outerEnum;
/**
* Default constructor
* @deprecated Use {@link EnumTest#EnumTest(EnumStringRequiredEnum)}
*/
@Deprecated
public EnumTest() {
super();
}
/**
* Constructor with only required parameters
*/
public EnumTest(EnumStringRequiredEnum enumStringRequired) {
this.enumStringRequired = enumStringRequired;
}
public EnumTest enumString(EnumStringEnum enumString) {
this.enumString = enumString;
return this;

View File

@@ -30,7 +30,7 @@ public class FileSchemaTestClass {
@JsonProperty("files")
@Valid
private List<File> files = null;
private List<@Valid File> files = null;
public FileSchemaTestClass file(File file) {
this.file = file;
@@ -51,7 +51,7 @@ public class FileSchemaTestClass {
this.file = file;
}
public FileSchemaTestClass files(List<File> files) {
public FileSchemaTestClass files(List<@Valid File> files) {
this.files = files;
return this;
}
@@ -70,11 +70,11 @@ public class FileSchemaTestClass {
*/
@Valid
@ApiModelProperty(value = "")
public List<File> getFiles() {
public List<@Valid File> getFiles() {
return files;
}
public void setFiles(List<File> files) {
public void setFiles(List<@Valid File> files) {
this.files = files;
}

View File

@@ -74,6 +74,25 @@ public class FormatTest {
@JsonProperty("BigDecimal")
private BigDecimal bigDecimal;
/**
* Default constructor
* @deprecated Use {@link FormatTest#FormatTest(BigDecimal, byte[], LocalDate, String)}
*/
@Deprecated
public FormatTest() {
super();
}
/**
* Constructor with only required parameters
*/
public FormatTest(BigDecimal number, byte[] _byte, LocalDate date, String password) {
this.number = number;
this._byte = _byte;
this.date = date;
this.password = password;
}
public FormatTest integer(Integer integer) {
this.integer = integer;
return this;

View File

@@ -35,6 +35,22 @@ public class Name {
@JsonProperty("123Number")
private Integer _123number;
/**
* Default constructor
* @deprecated Use {@link Name#Name(Integer)}
*/
@Deprecated
public Name() {
super();
}
/**
* Constructor with only required parameters
*/
public Name(Integer name) {
this.name = name;
}
public Name name(Integer name) {
this.name = name;
return this;

View File

@@ -42,7 +42,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<Tag> tags = null;
private List<@Valid Tag> tags = null;
/**
* pet status in the store
@@ -84,6 +84,23 @@ public class Pet {
@JsonProperty("status")
private StatusEnum status;
/**
* Default constructor
* @deprecated Use {@link Pet#Pet(String, List<String>)}
*/
@Deprecated
public Pet() {
super();
}
/**
* Constructor with only required parameters
*/
public Pet(String name, List<String> photoUrls) {
this.name = name;
this.photoUrls = photoUrls;
}
public Pet id(Long id) {
this.id = id;
return this;
@@ -165,7 +182,7 @@ public class Pet {
this.photoUrls = photoUrls;
}
public Pet tags(List<Tag> tags) {
public Pet tags(List<@Valid Tag> tags) {
this.tags = tags;
return this;
}
@@ -184,11 +201,11 @@ public class Pet {
*/
@Valid
@ApiModelProperty(value = "")
public List<Tag> getTags() {
public List<@Valid Tag> getTags() {
return tags;
}
public void setTags(List<Tag> tags) {
public void setTags(List<@Valid Tag> tags) {
this.tags = tags;
}

View File

@@ -41,6 +41,26 @@ public class TypeHolderDefault {
@Valid
private List<Integer> arrayItem = new ArrayList<>();
/**
* Default constructor
* @deprecated Use {@link TypeHolderDefault#TypeHolderDefault(String, BigDecimal, Integer, Boolean, List<Integer>)}
*/
@Deprecated
public TypeHolderDefault() {
super();
}
/**
* Constructor with only required parameters
*/
public TypeHolderDefault(String stringItem, BigDecimal numberItem, Integer integerItem, Boolean boolItem, List<Integer> arrayItem) {
this.stringItem = stringItem;
this.numberItem = numberItem;
this.integerItem = integerItem;
this.boolItem = boolItem;
this.arrayItem = arrayItem;
}
public TypeHolderDefault stringItem(String stringItem) {
this.stringItem = stringItem;
return this;

View File

@@ -44,6 +44,27 @@ public class TypeHolderExample {
@Valid
private List<Integer> arrayItem = new ArrayList<>();
/**
* Default constructor
* @deprecated Use {@link TypeHolderExample#TypeHolderExample(String, BigDecimal, Float, Integer, Boolean, List<Integer>)}
*/
@Deprecated
public TypeHolderExample() {
super();
}
/**
* Constructor with only required parameters
*/
public TypeHolderExample(String stringItem, BigDecimal numberItem, Float floatItem, Integer integerItem, Boolean boolItem, List<Integer> arrayItem) {
this.stringItem = stringItem;
this.numberItem = numberItem;
this.floatItem = floatItem;
this.integerItem = integerItem;
this.boolItem = boolItem;
this.arrayItem = arrayItem;
}
public TypeHolderExample stringItem(String stringItem) {
this.stringItem = stringItem;
return this;

View File

@@ -391,7 +391,7 @@ paths:
- tag: store
get:
description: For valid response try integer IDs with value <= 5 or > 10. Other
values will generated exceptions
values will generate exceptions
operationId: getOrderById
parameters:
- description: ID of pet that needs to be fetched
@@ -713,7 +713,7 @@ paths:
responses:
"400":
content: {}
description: Someting wrong
description: Something wrong
summary: Fake endpoint to test group parameters (optional)
tags:
- fake
@@ -1213,6 +1213,135 @@ paths:
x-accepts: application/json
x-tags:
- tag: pet
/versioning/headers:
post:
operationId: versioningHeaders
parameters:
- in: header
name: VersionWithDefaultValue
required: true
schema:
default: V1
type: string
x-version-param: true
x-version-param: true
- in: header
name: VersionNoDefaultValue
required: true
schema:
type: string
x-version-param: true
x-version-param: true
- description: ID of pet to update
in: path
name: petId
required: true
schema:
format: int64
type: integer
responses:
"200":
content:
'*/*':
schema:
$ref: '#/components/schemas/ApiResponse'
description: successful operation
tags:
- versioning
x-accepts: '*/*'
x-tags:
- tag: versioning
/versioning/query-params:
post:
operationId: versioningQueryParams
parameters:
- in: query
name: VersionWithDefaultValue
required: true
schema:
default: V1
type: string
x-version-param: true
x-version-param: true
- in: query
name: VersionNoDefaultValue
required: true
schema:
type: string
x-version-param: true
x-version-param: true
- description: ID of pet to update
in: path
name: petId
required: true
schema:
format: int64
type: integer
responses:
"200":
content:
'*/*':
schema:
$ref: '#/components/schemas/ApiResponse'
description: successful operation
tags:
- versioning
x-accepts: '*/*'
x-tags:
- tag: versioning
/versioning/mix:
post:
operationId: versioningMix
parameters:
- in: query
name: VersionWithDefaultValueQuery
required: true
schema:
default: V1
type: string
x-version-param: true
x-version-param: true
- in: query
name: VersionNoDefaultValueQuery
required: true
schema:
type: string
x-version-param: true
x-version-param: true
- in: header
name: VersionWithDefaultValueHeader
required: true
schema:
default: V1
type: string
x-version-param: true
x-version-param: true
- in: header
name: VersionNoDefaultValueHeader
required: true
schema:
type: string
x-version-param: true
x-version-param: true
- description: ID of pet to update
in: path
name: petId
required: true
schema:
format: int64
type: integer
responses:
"200":
content:
'*/*':
schema:
$ref: '#/components/schemas/ApiResponse'
description: successful operation
tags:
- versioning
x-accepts: '*/*'
x-tags:
- tag: versioning
components:
schemas:
Order: