Closed waltkb closed 1 month ago
Could probably be fixed with #107
Hi,
i'm not quite sure where buildJsonObject
comes from or what type it exactly returns, but you should be able to provide the example as an json string here.
example("E-mail + password") {
value = buildJsonObject {
put("type", JsonPrimitive("email"))
put("email", JsonPrimitive("user@email.com"))
put("password", JsonPrimitive("password"))
}.toJsonString() // ... or something that turns the result of buildJsonObject into a json-string
}
I think this could then be done automatically with the config provided with https://github.com/SMILEY4/ktor-swagger-ui/pull/107 so you dont need to convert to string for every individual example.
An example like this:
Does not come out as a simple JSON like this:
But instead produces this example: