package com.cgm.de.swaggerNativeBugDemo.controller import com.cgm.de.swaggerNativeBugDemo.controller.dto.DifficultClass import io.swagger.v3.oas.annotations.Operation import org.springframework.web.bind.annotation.* @RestController @RequestMapping("/") // the below register is a fix for swagger ui for native image. We could not find out the reason, // but the class will cause a "Type not found" and leave the swagger screen in a half-ready state. //@RegisterReflectionForBinding(java.lang.invoke.MethodHandles.Lookup::class) class DifficultController { @PostMapping("a") @Operation(summary = "reproduce the problem") fun someFunction(@RequestBody problems: List) : DifficultClass? { return if (problems.isEmpty()) null else problems.first() } }