我正在嘗試使用
uj5u.com熱心網友回復:
我猜你沒有正確 C&P。
我只是用你的檔案設定了一個測驗專案,并使用了 openapi-generator-cli.jar 和命令:
java -jar openapi-generator-cli.jar generate -i stack.yml -g spring -p java8=true
我創建了專案,錯誤類出現了:
package org.openapitools.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 org.openapitools.jackson.nullable.JsonNullable;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* Error
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2022-04-05T08:34:53.094779300 02:00[Europe/Berlin]")
public class Error {
@JsonProperty("id")
private String id;
@JsonProperty("message")
private String message;
public Error id(String id) {
this.id = id;
return this;
}
/**
* Unique id to represent a type of error
* @return id
*/
@ApiModelProperty(example = "bad_request", value = "Unique id to represent a type of error")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Error message(String message) {
this.message = message;
return this;
}
/**
* Meaningful message about what went wrong
* @return message
*/
@ApiModelProperty(example = "dealer id already exists", value = "Meaningful message about what went wrong")
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Error error = (Error) o;
return Objects.equals(this.id, error.id) &&
Objects.equals(this.message, error.message);
}
@Override
public int hashCode() {
return Objects.hash(id, message);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Error {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" message: ").append(toIndentedString(message)).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 ");
}
}
此外,我能夠啟動并接收模式:

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/456141.html
上一篇:如何在沒有運行Elasticsearch服務器的情況下運行springboot應用程式?
下一篇:DC-1 靶機滲透
