Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
docs(incept): describe request and response formats with examples
Browse files Browse the repository at this point in the history
  • Loading branch information
aminbenmansour committed Oct 25, 2023
1 parent cfa84ed commit 272ab98
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/main/kotlin/id/walt/web/controllers/KeriController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package id.walt.web.controllers
import id.walt.service.dto.KeriCreateDbRequest
import id.walt.service.dto.KeriCreateDbResponse
import id.walt.service.dto.KeriInceptionRequest
import id.walt.service.dto.KeriInceptionResponse
import id.walt.service.keri.KeriInceptionService
import id.walt.service.keri.KeriInitService
import io.github.smiley4.ktorswaggerui.dsl.post
Expand Down Expand Up @@ -57,7 +58,32 @@ fun Application.keri() = walletRoute {
}

post("incept/{name}", {
summary = "Initialize a prefix"
summary = "Create an inception event to initiate a controller"

request {
pathParameter<String>("name") {
description = "keystore name and file location of KERI keystore"
example = "waltid"
}

body<KeriInceptionRequest> {
description = "Required data for the inception of a controller"
example("application/json", KeriInceptionRequest(alias = "waltid-alias", passcode = "0123456789abcdefghijk"))
}

}
response {
HttpStatusCode.Created to {
body<String> {
description = "The identifiers of the controller. An AID, DID and public keys"
example("application/json", KeriInceptionResponse(aid = "EPjNBI4spoZ3lU5OCtNO4QgJmhIw7P1T-JOtwit36do4", did = "did:keri:EPjNBI4spoZ3lU5OCtNO4QgJmhIw7P1T-JOtwit36do4", publicKeys = listOf(
"DOERpUwwYCSyWH8e8yLJDKZpvEly_oJ8QJPw2wH3qRVQ"
))) {
summary = "Example of creating an inception event (First event in a Key Event Log (KEL))"
}
}
}
}
}) {
val name = call.parameters["name"] ?: return@post call.respond(HttpStatusCode.BadRequest)
val dto = call.receive<KeriInceptionRequest>()
Expand Down

0 comments on commit 272ab98

Please sign in to comment.