V2 Request - SMILEY4/ktor-openapi-tools GitHub Wiki

Information about a request is added in the request-block of a route-documentation.

get("example", {
    // ...
    request {
	pathParameter<String>("pathParam")
        queryParameter<String>("queryParam")
        headerParameter<String>("headerParam")
        body<String>()
    }
}) {
	// handle request...
}
  • pathParameter<Type>("name") - documentation of a path-parameter of the given type with the given name. See Parameters for more information.
  • queryParameter<Type>("name") - documentation of a query-parameter of the given type with the given name. See Parameters for more information.
  • headerParameter<Type>("name") - documentation of a header-parameter of the given type with the given name. See Parameters for more information.
  • body<Type> - documentation of the request body of the given type. See Request and Response Bodies for more information.

More information:

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