Closed SerVB closed 4 years ago
made appropriate modifications in the rewoked-model branch.
implementation 'com.github.papsign:Ktor-OpenAPI-Generator:reworked-model-SNAPSHOT'
and to remove null and empty fields:
get("/openapi.json") {
call.respond(application.openAPIGen.api.build())
}
It will be merged into master when it is determined as clean and maintainable.
Yep, this works! A small concern here that .build()
is executed every time the request is performed. Maybe it's better to use a lazy property to store the built schema.
It is possible, in principle, to create new routes during runtime, so the model can in principle change. This is up to the user.
In the models section, there are redundant fields:
Current workaround is activating
mapper.setSerializationInclusion(Include.NON_NULL)
for Jackson.However, it changes the way the server answers, so it's not a solution in some cases.
I think the solution can be just to omit generating
minimum
andmaximum
forstring
andboolean
in the models section.This is an issue extracted from #12.