Skip to content

Instantly share code, notes, and snippets.

@digimon1740
Created October 23, 2019 13:43
Show Gist options
  • Save digimon1740/2e6a7907b3e7c38e9e14662293113c85 to your computer and use it in GitHub Desktop.
Save digimon1740/2e6a7907b3e7c38e9e14662293113c85 to your computer and use it in GitHub Desktop.
@OpenApi(
requestBody = OpenApiRequestBody(User::class),
responses = [
OpenApiResponse("400", Unit::class),
OpenApiResponse("201", Unit::class)
]
)
fun addUserHandler(ctx: Context) {
val user = ctx.body()
UserRepository.createUser(user)
ctx.status(201)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment