[kotlin-spring] add reactive behavior via Kotlin coroutines (#2934)

* kotlin spring : add reactivity via kotlin's coroutines

* add kotlin spring boot reactive samples

* bug : fix spring version and import for coroutines

* remove exception handler for reactive (webflux doesn't support it)

* add spring milestone repository to maven pom

* add reactive type for list in Api and ApiImpl methodes for mathching body responsive parameter

* fix baseType for ArraySchema

* regenerate samples

* updating documentation
This commit is contained in:
sylvainmoindron
2019-06-02 21:50:45 +02:00
committed by Jim Schubert
parent b74fa4458d
commit 7916f2f880
146 changed files with 3078 additions and 268 deletions

View File

@@ -12,7 +12,7 @@ import io.swagger.annotations.AuthorizationScope
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.RequestBody
import org.springframework.web.bind.annotation.RequestPart
import org.springframework.web.bind.annotation.RequestParam
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestHeader
import org.springframework.web.bind.annotation.RequestMethod
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import org.springframework.validation.annotation.Validated
import org.springframework.web.context.request.NativeWebRequest
import org.springframework.beans.factory.annotation.Autowired
@@ -36,7 +37,7 @@ import javax.validation.constraints.Size
import kotlin.collections.List
import kotlin.collections.Map
@Controller
@RestController
@Validated
@Api(value = "Pet", description = "The Pet API")
@RequestMapping("\${api.base-path:/v2}")

View File

@@ -2,22 +2,21 @@ package org.openapitools.api
import org.openapitools.model.ModelApiResponse
import org.openapitools.model.Pet
interface PetApiService {
fun addPet(body: Pet): Unit
fun addPet(body: Pet): Unit
fun deletePet(petId: Long, apiKey: String?): Unit
fun deletePet(petId: Long, apiKey: String?): Unit
fun findPetsByStatus(status: List<String>): List<Pet>
fun findPetsByStatus(status: List<String>): List<Pet>
fun findPetsByTags(tags: List<String>): List<Pet>
fun findPetsByTags(tags: List<String>): List<Pet>
fun getPetById(petId: Long): Pet
fun getPetById(petId: Long): Pet
fun updatePet(body: Pet): Unit
fun updatePet(body: Pet): Unit
fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit
fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit
fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse
fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse
}

View File

@@ -11,7 +11,7 @@ import io.swagger.annotations.AuthorizationScope
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.RequestBody
import org.springframework.web.bind.annotation.RequestPart
import org.springframework.web.bind.annotation.RequestParam
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestHeader
import org.springframework.web.bind.annotation.RequestMethod
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import org.springframework.validation.annotation.Validated
import org.springframework.web.context.request.NativeWebRequest
import org.springframework.beans.factory.annotation.Autowired
@@ -35,7 +36,7 @@ import javax.validation.constraints.Size
import kotlin.collections.List
import kotlin.collections.Map
@Controller
@RestController
@Validated
@Api(value = "Store", description = "The Store API")
@RequestMapping("\${api.base-path:/v2}")

View File

@@ -1,14 +1,13 @@
package org.openapitools.api
import org.openapitools.model.Order
interface StoreApiService {
fun deleteOrder(orderId: String): Unit
fun deleteOrder(orderId: String): Unit
fun getInventory(): Map<String, Int>
fun getInventory(): Map<String, Int>
fun getOrderById(orderId: Long): Order
fun getOrderById(orderId: Long): Order
fun placeOrder(body: Order): Order
fun placeOrder(body: Order): Order
}

View File

@@ -11,7 +11,7 @@ import io.swagger.annotations.AuthorizationScope
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.RequestBody
import org.springframework.web.bind.annotation.RequestPart
import org.springframework.web.bind.annotation.RequestParam
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestHeader
import org.springframework.web.bind.annotation.RequestMethod
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import org.springframework.validation.annotation.Validated
import org.springframework.web.context.request.NativeWebRequest
import org.springframework.beans.factory.annotation.Autowired
@@ -35,7 +36,7 @@ import javax.validation.constraints.Size
import kotlin.collections.List
import kotlin.collections.Map
@Controller
@RestController
@Validated
@Api(value = "User", description = "The User API")
@RequestMapping("\${api.base-path:/v2}")

View File

@@ -1,22 +1,21 @@
package org.openapitools.api
import org.openapitools.model.User
interface UserApiService {
fun createUser(body: User): Unit
fun createUser(body: User): Unit
fun createUsersWithArrayInput(body: List<User>): Unit
fun createUsersWithArrayInput(body: List<User>): Unit
fun createUsersWithListInput(body: List<User>): Unit
fun createUsersWithListInput(body: List<User>): Unit
fun deleteUser(username: String): Unit
fun deleteUser(username: String): Unit
fun getUserByName(username: String): User
fun getUserByName(username: String): User
fun loginUser(username: String, password: String): String
fun loginUser(username: String, password: String): String
fun logoutUser(): Unit
fun logoutUser(): Unit
fun updateUser(username: String, body: User): Unit
fun updateUser(username: String, body: User): Unit
}