forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin' into 7.0.x
This commit is contained in:
@@ -39,8 +39,8 @@ Do not edit the class manually.
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<org.springframework.boot.version>2.6.2</org.springframework.boot.version>
|
||||
<org.apache.camel.version>3.14.0</org.apache.camel.version>
|
||||
<org.springframework.boot.version>2.7.8</org.springframework.boot.version>
|
||||
<org.apache.camel.version>3.20.1</org.apache.camel.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@@ -74,10 +74,9 @@ Do not edit the class manually.
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>3.10.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<release>11</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -117,7 +116,7 @@ Do not edit the class manually.
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>0.2.1</version>
|
||||
<version>0.2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
@@ -127,17 +126,17 @@ Do not edit the class manually.
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>2.1.11</version>
|
||||
<version>2.2.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.14.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jdk8</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.14.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.camel</groupId>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ public class RestConfiguration extends RouteBuilder {
|
||||
@Override
|
||||
public void configure() throws Exception {
|
||||
restConfiguration()
|
||||
.scheme("http")
|
||||
.host("petstore.swagger.io")
|
||||
.component("servlet")
|
||||
.bindingMode(RestBindingMode.auto)
|
||||
.dataFormatProperty("json.out.disableFeatures", "WRITE_DATES_AS_TIMESTAMPS")
|
||||
|
||||
@@ -74,7 +74,7 @@ public class PetApi extends RouteBuilder {
|
||||
.description("Pet id to delete")
|
||||
.endParam()
|
||||
.param()
|
||||
.name("apiKey")
|
||||
.name("api_key")
|
||||
.type(RestParamType.header)
|
||||
.required(false)
|
||||
.endParam()
|
||||
|
||||
@@ -48,7 +48,7 @@ public class PetApiRoutesImpl extends RouteBuilder {
|
||||
.log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}")
|
||||
.end()
|
||||
.log(LoggingLevel.INFO, "HEADERS: ${headers}")
|
||||
.setBody(constant("[{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }]"))
|
||||
.setBody(constant("[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"))
|
||||
.unmarshal().json(JsonLibrary.Jackson, Pet[].class);
|
||||
/**
|
||||
GET /pet/findByTags : Finds Pets by tags
|
||||
@@ -60,7 +60,7 @@ public class PetApiRoutesImpl extends RouteBuilder {
|
||||
.log(LoggingLevel.INFO, "BODY TYPE: ${body.getClass().getName()}")
|
||||
.end()
|
||||
.log(LoggingLevel.INFO, "HEADERS: ${headers}")
|
||||
.setBody(constant("[{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }]"))
|
||||
.setBody(constant("[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"))
|
||||
.unmarshal().json(JsonLibrary.Jackson, Pet[].class);
|
||||
/**
|
||||
GET /pet/{petId} : Find pet by ID
|
||||
|
||||
@@ -48,7 +48,7 @@ public class Category {
|
||||
* @return id
|
||||
*/
|
||||
|
||||
@Schema(name = "id", required = false)
|
||||
@Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class Category {
|
||||
* @return name
|
||||
*/
|
||||
@Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")
|
||||
@Schema(name = "name", required = false)
|
||||
@Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ModelApiResponse {
|
||||
* @return code
|
||||
*/
|
||||
|
||||
@Schema(name = "code", required = false)
|
||||
@Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class ModelApiResponse {
|
||||
* @return type
|
||||
*/
|
||||
|
||||
@Schema(name = "type", required = false)
|
||||
@Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ public class ModelApiResponse {
|
||||
* @return message
|
||||
*/
|
||||
|
||||
@Schema(name = "message", required = false)
|
||||
@Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class Order {
|
||||
* @return id
|
||||
*/
|
||||
|
||||
@Schema(name = "id", required = false)
|
||||
@Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -124,7 +124,7 @@ public class Order {
|
||||
* @return petId
|
||||
*/
|
||||
|
||||
@Schema(name = "petId", required = false)
|
||||
@Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public class Order {
|
||||
* @return quantity
|
||||
*/
|
||||
|
||||
@Schema(name = "quantity", required = false)
|
||||
@Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ public class Order {
|
||||
* @return shipDate
|
||||
*/
|
||||
@Valid
|
||||
@Schema(name = "shipDate", required = false)
|
||||
@Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public Date getShipDate() {
|
||||
return shipDate;
|
||||
}
|
||||
@@ -181,7 +181,7 @@ public class Order {
|
||||
* @return status
|
||||
*/
|
||||
|
||||
@Schema(name = "status", description = "Order Status", required = false)
|
||||
@Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
@@ -200,7 +200,7 @@ public class Order {
|
||||
* @return complete
|
||||
*/
|
||||
|
||||
@Schema(name = "complete", required = false)
|
||||
@Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public Boolean getComplete() {
|
||||
return complete;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class Pet {
|
||||
@JsonProperty("tags")
|
||||
@JacksonXmlProperty(localName = "tag")
|
||||
@Valid
|
||||
private List<Tag> tags = null;
|
||||
private List<@Valid Tag> tags = null;
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
@@ -98,6 +98,23 @@ public class Pet {
|
||||
@JacksonXmlProperty(localName = "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;
|
||||
@@ -108,7 +125,7 @@ public class Pet {
|
||||
* @return id
|
||||
*/
|
||||
|
||||
@Schema(name = "id", required = false)
|
||||
@Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -127,7 +144,7 @@ public class Pet {
|
||||
* @return category
|
||||
*/
|
||||
@Valid
|
||||
@Schema(name = "category", required = false)
|
||||
@Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public Category getCategory() {
|
||||
return category;
|
||||
}
|
||||
@@ -146,7 +163,7 @@ public class Pet {
|
||||
* @return name
|
||||
*/
|
||||
@NotNull
|
||||
@Schema(name = "name", example = "doggie", required = true)
|
||||
@Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -170,7 +187,7 @@ public class Pet {
|
||||
* @return photoUrls
|
||||
*/
|
||||
@NotNull
|
||||
@Schema(name = "photoUrls", required = true)
|
||||
@Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
public List<String> getPhotoUrls() {
|
||||
return photoUrls;
|
||||
}
|
||||
@@ -179,7 +196,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;
|
||||
}
|
||||
@@ -197,12 +214,12 @@ public class Pet {
|
||||
* @return tags
|
||||
*/
|
||||
@Valid
|
||||
@Schema(name = "tags", required = false)
|
||||
public List<Tag> getTags() {
|
||||
@Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public List<@Valid Tag> getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
public void setTags(List<Tag> tags) {
|
||||
public void setTags(List<@Valid Tag> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
@@ -216,7 +233,7 @@ public class Pet {
|
||||
* @return status
|
||||
*/
|
||||
|
||||
@Schema(name = "status", description = "pet status in the store", required = false)
|
||||
@Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public StatusEnum getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class Tag {
|
||||
* @return id
|
||||
*/
|
||||
|
||||
@Schema(name = "id", required = false)
|
||||
@Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class Tag {
|
||||
* @return name
|
||||
*/
|
||||
|
||||
@Schema(name = "name", required = false)
|
||||
@Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class User {
|
||||
* @return id
|
||||
*/
|
||||
|
||||
@Schema(name = "id", required = false)
|
||||
@Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ public class User {
|
||||
* @return username
|
||||
*/
|
||||
|
||||
@Schema(name = "username", required = false)
|
||||
@Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public class User {
|
||||
* @return firstName
|
||||
*/
|
||||
|
||||
@Schema(name = "firstName", required = false)
|
||||
@Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public class User {
|
||||
* @return lastName
|
||||
*/
|
||||
|
||||
@Schema(name = "lastName", required = false)
|
||||
@Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public class User {
|
||||
* @return email
|
||||
*/
|
||||
|
||||
@Schema(name = "email", required = false)
|
||||
@Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
@@ -167,7 +167,7 @@ public class User {
|
||||
* @return password
|
||||
*/
|
||||
|
||||
@Schema(name = "password", required = false)
|
||||
@Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public class User {
|
||||
* @return phone
|
||||
*/
|
||||
|
||||
@Schema(name = "phone", required = false)
|
||||
@Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
@@ -205,7 +205,7 @@ public class User {
|
||||
* @return userStatus
|
||||
*/
|
||||
|
||||
@Schema(name = "userStatus", description = "User Status", required = false)
|
||||
@Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
public Integer getUserStatus() {
|
||||
return userStatus;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user