forked from loafle/openapi-generator-original
update kotlin samples
This commit is contained in:
parent
a6807a73e5
commit
b36b65964f
@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty
|
||||
* @param id
|
||||
* @param name
|
||||
*/
|
||||
data class Category (
|
||||
data class Category(
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name") val name: kotlin.String? = null
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name") val name: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -17,16 +17,16 @@ import io.swagger.annotations.ApiModelProperty
|
||||
* @param type
|
||||
* @param message
|
||||
*/
|
||||
data class ModelApiResponse (
|
||||
data class ModelApiResponse(
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("code") val code: kotlin.Int? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("code") val code: kotlin.Int? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("type") val type: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("type") val type: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("message") val message: kotlin.String? = null
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("message") val message: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -21,25 +21,25 @@ import io.swagger.annotations.ApiModelProperty
|
||||
* @param status Order Status
|
||||
* @param complete
|
||||
*/
|
||||
data class Order (
|
||||
data class Order(
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("petId") val petId: kotlin.Long? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("petId") val petId: kotlin.Long? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("quantity") val quantity: kotlin.Int? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("quantity") val quantity: kotlin.Int? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "Order Status")
|
||||
@JsonProperty("status") val status: Order.Status? = null,
|
||||
@ApiModelProperty(example = "null", value = "Order Status")
|
||||
@JsonProperty("status") val status: Order.Status? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("complete") val complete: kotlin.Boolean? = null
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("complete") val complete: kotlin.Boolean? = null
|
||||
) {
|
||||
|
||||
/**
|
||||
|
@ -23,27 +23,27 @@ import io.swagger.annotations.ApiModelProperty
|
||||
* @param tags
|
||||
* @param status pet status in the store
|
||||
*/
|
||||
data class Pet (
|
||||
data class Pet(
|
||||
|
||||
@get:NotNull
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@JsonProperty("name") val name: kotlin.String,
|
||||
@get:NotNull
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@JsonProperty("name") val name: kotlin.String,
|
||||
|
||||
@get:NotNull
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
@JsonProperty("photoUrls") val photoUrls: kotlin.collections.List<kotlin.String>,
|
||||
@get:NotNull
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
@JsonProperty("photoUrls") val photoUrls: kotlin.collections.List<kotlin.String>,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("category") val category: Category? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("category") val category: Category? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("tags") val tags: kotlin.collections.List<Tag>? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("tags") val tags: kotlin.collections.List<Tag>? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "pet status in the store")
|
||||
@JsonProperty("status") val status: Pet.Status? = null
|
||||
@ApiModelProperty(example = "null", value = "pet status in the store")
|
||||
@JsonProperty("status") val status: Pet.Status? = null
|
||||
) {
|
||||
|
||||
/**
|
||||
|
@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty
|
||||
* @param id
|
||||
* @param name
|
||||
*/
|
||||
data class Tag (
|
||||
data class Tag(
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name") val name: kotlin.String? = null
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name") val name: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -22,31 +22,31 @@ import io.swagger.annotations.ApiModelProperty
|
||||
* @param phone
|
||||
* @param userStatus User Status
|
||||
*/
|
||||
data class User (
|
||||
data class User(
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("username") val username: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("username") val username: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("firstName") val firstName: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("firstName") val firstName: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("lastName") val lastName: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("lastName") val lastName: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("email") val email: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("email") val email: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("password") val password: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("password") val password: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("phone") val phone: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("phone") val phone: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "User Status")
|
||||
@JsonProperty("userStatus") val userStatus: kotlin.Int? = null
|
||||
@ApiModelProperty(example = "null", value = "User Status")
|
||||
@JsonProperty("userStatus") val userStatus: kotlin.Int? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -17,13 +17,13 @@ class DefaultExceptionHandler {
|
||||
|
||||
@ExceptionHandler(value = [ApiException::class])
|
||||
fun onApiException(ex: ApiException, response: HttpServletResponse): Unit =
|
||||
response.sendError(ex.code, ex.message)
|
||||
response.sendError(ex.code, ex.message)
|
||||
|
||||
@ExceptionHandler(value = [NotImplementedError::class])
|
||||
fun onNotImplemented(ex: NotImplementedError, response: HttpServletResponse): Unit =
|
||||
response.sendError(HttpStatus.NOT_IMPLEMENTED.value())
|
||||
response.sendError(HttpStatus.NOT_IMPLEMENTED.value())
|
||||
|
||||
@ExceptionHandler(value = [ConstraintViolationException::class])
|
||||
fun onConstraintViolation(ex: ConstraintViolationException, response: HttpServletResponse): Unit =
|
||||
response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message })
|
||||
response.sendError(HttpStatus.BAD_REQUEST.value(), ex.constraintViolations.joinToString(", ") { it.message })
|
||||
}
|
||||
|
@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty
|
||||
* @param id
|
||||
* @param name
|
||||
*/
|
||||
data class Category (
|
||||
data class Category(
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name") val name: kotlin.String? = null
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name") val name: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -17,16 +17,16 @@ import io.swagger.annotations.ApiModelProperty
|
||||
* @param type
|
||||
* @param message
|
||||
*/
|
||||
data class ModelApiResponse (
|
||||
data class ModelApiResponse(
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("code") val code: kotlin.Int? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("code") val code: kotlin.Int? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("type") val type: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("type") val type: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("message") val message: kotlin.String? = null
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("message") val message: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -21,25 +21,25 @@ import io.swagger.annotations.ApiModelProperty
|
||||
* @param status Order Status
|
||||
* @param complete
|
||||
*/
|
||||
data class Order (
|
||||
data class Order(
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("petId") val petId: kotlin.Long? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("petId") val petId: kotlin.Long? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("quantity") val quantity: kotlin.Int? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("quantity") val quantity: kotlin.Int? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "Order Status")
|
||||
@JsonProperty("status") val status: Order.Status? = null,
|
||||
@ApiModelProperty(example = "null", value = "Order Status")
|
||||
@JsonProperty("status") val status: Order.Status? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("complete") val complete: kotlin.Boolean? = null
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("complete") val complete: kotlin.Boolean? = null
|
||||
) {
|
||||
|
||||
/**
|
||||
|
@ -23,27 +23,27 @@ import io.swagger.annotations.ApiModelProperty
|
||||
* @param tags
|
||||
* @param status pet status in the store
|
||||
*/
|
||||
data class Pet (
|
||||
data class Pet(
|
||||
|
||||
@get:NotNull
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@JsonProperty("name") val name: kotlin.String,
|
||||
@get:NotNull
|
||||
@ApiModelProperty(example = "doggie", required = true, value = "")
|
||||
@JsonProperty("name") val name: kotlin.String,
|
||||
|
||||
@get:NotNull
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
@JsonProperty("photoUrls") val photoUrls: kotlin.collections.List<kotlin.String>,
|
||||
@get:NotNull
|
||||
@ApiModelProperty(example = "null", required = true, value = "")
|
||||
@JsonProperty("photoUrls") val photoUrls: kotlin.collections.List<kotlin.String>,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("category") val category: Category? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("category") val category: Category? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("tags") val tags: kotlin.collections.List<Tag>? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("tags") val tags: kotlin.collections.List<Tag>? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "pet status in the store")
|
||||
@JsonProperty("status") val status: Pet.Status? = null
|
||||
@ApiModelProperty(example = "null", value = "pet status in the store")
|
||||
@JsonProperty("status") val status: Pet.Status? = null
|
||||
) {
|
||||
|
||||
/**
|
||||
|
@ -16,13 +16,13 @@ import io.swagger.annotations.ApiModelProperty
|
||||
* @param id
|
||||
* @param name
|
||||
*/
|
||||
data class Tag (
|
||||
data class Tag(
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name") val name: kotlin.String? = null
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("name") val name: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -22,31 +22,31 @@ import io.swagger.annotations.ApiModelProperty
|
||||
* @param phone
|
||||
* @param userStatus User Status
|
||||
*/
|
||||
data class User (
|
||||
data class User(
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("username") val username: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("username") val username: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("firstName") val firstName: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("firstName") val firstName: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("lastName") val lastName: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("lastName") val lastName: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("email") val email: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("email") val email: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("password") val password: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("password") val password: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("phone") val phone: kotlin.String? = null,
|
||||
@ApiModelProperty(example = "null", value = "")
|
||||
@JsonProperty("phone") val phone: kotlin.String? = null,
|
||||
|
||||
@ApiModelProperty(example = "null", value = "User Status")
|
||||
@JsonProperty("userStatus") val userStatus: kotlin.Int? = null
|
||||
@ApiModelProperty(example = "null", value = "User Status")
|
||||
@JsonProperty("userStatus") val userStatus: kotlin.Int? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user