Anyone can help with ktor?

I'm trying to implement kompendium for openapi autogeneration (https://github.com/bkbnio/kompendium) I have done same thing as in docs
fun Routing.userRouting() {
route("/api/user-service") {
...

/* ROUTE */
route("/create-new-user") {

// models
@Serializable
data class RequestBody (
val name: String,
val email: String,
val password: String,
)

// spec
install(NotarizedRoute()) {
tags = setOf("User service")
post = PostInfo.builder {
summary("summary")
description("description")
request {
requestType<String>() // <- <RequestBody> causes another exception here...
description("desc")
}
response {
responseCode(HttpStatusCode.OK)
responseType<String>()
description("desc")
}
}
}

// handler
post {
val body = call.receiveValid<RequestBody>()
UserService.createNewUser(
name = body.name,
email = body.email,
rawPassword = body.password,
log = call.application.environment.log
)
call.respond(HttpStatusCode.OK, "OK") // if ok
}
}

...
}
}
fun Routing.userRouting() {
route("/api/user-service") {
...

/* ROUTE */
route("/create-new-user") {

// models
@Serializable
data class RequestBody (
val name: String,
val email: String,
val password: String,
)

// spec
install(NotarizedRoute()) {
tags = setOf("User service")
post = PostInfo.builder {
summary("summary")
description("description")
request {
requestType<String>() // <- <RequestBody> causes another exception here...
description("desc")
}
response {
responseCode(HttpStatusCode.OK)
responseType<String>()
description("desc")
}
}
}

// handler
post {
val body = call.receiveValid<RequestBody>()
UserService.createNewUser(
name = body.name,
email = body.email,
rawPassword = body.password,
log = call.application.environment.log
)
call.respond(HttpStatusCode.OK, "OK") // if ok
}
}

...
}
}
But, here's redoc and swagger results:
No description
No description
5 Replies
JavaBot
JavaBot4mo ago
This post has been reserved for your question.
Hey @Tusya <3! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Tusya <3
Tusya <3OP4mo ago
Anyone knows how to fix it?
JavaBot
JavaBot4mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
JavaBot
JavaBot4mo ago
Help Guidelines
1. Don't ask questions like "Can I ask ...?" or "Can someone help me?". It's easier for everyone involved if you provide a detailed description of your problem up-front; this makes it more likely for helpers to want to help, and more likely that you'll get an answer quickly. Please provide code snippets and error messages (if any) to help us help you! 2. Please create a post in <#1023632039829831811> for your questions. Do not use other people's posts for your questions. 3. You may use the /help ping command if your question is urgent. Abusing this will result in warnings and/or a ban. 4. Do not ask for help with exams or homework. You may ask for help with understanding individual concepts and parts of a question, but homework and exam questions that show little effort on your part will most likely go unanswered and may be removed. 5. Do not ask your question if you didn't at least try to solve the problem yourself, are ignorant, or, instead of trying to improve, ask repeating, simple, questions. 6. Format your code using Discord's triple-backtick syntax. 7. For reasons similar to those of Stack Overflow, we currently do not allow content created by ChatGPT while helping other people. You may still share its content, when you are not helping somebody and are not looking to deceive others, for example when discussing ChatGPT and its technology.
From An unknown user
JavaBot
JavaBot4mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server