V2 Request and Response Bodies - SMILEY4/ktor-openapi-tools GitHub Wiki

Information about request and response bodies can be added in the respective blocks.

get("hello", {
    request {
        body<String>() {
            // document request body
        }
    }
    response {
        HttpStatusCode.OK to {
            body<String>() {
                // document response body for "OK"
            }
        }
        HttpStatusCode.NotFound to {
            body<String>() {
                // document response body for "Not Found"
            }
        }
    }
}) {
    // handle request...
}

More Information:

⚠️ **GitHub.com Fallback** ⚠️