Closed
Description
Unable to determine if it is a Kotlin type
To Reproduce
Steps to reproduce the behavior:
- What version of spring-boot you are using?
- 3.2.4
- What modules and versions of springdoc-openapi are you using?
- 2.4.0
- What is the actual and the expected result using OpenAPI Description (yml or json)?
- kotlin type isMarkedNullable
- Provide with a sample code (HelloController) or Test that reproduces the problem
interface AdminSysNoticePage {
@Operation(summary = "adminSysNoticePage", description = "adminSysNoticePage")
@GetMapping("adminSysNoticePage")
fun adminSysNoticePage(
@Validated request: AdminSysNoticePageRequest
): AdminSysNoticePageResponse
}
@Schema(description = "AdminSysNoticePageRequest")
data class AdminSysNoticePageRequest(
@field:Schema(description = "id not required", example = "")
var id: Long? = null,
@field:Schema(description = "noticeTitle is required", example = "")
var noticeTitle: String,
)
@Schema(description = " AdminSysNoticePageResponse")
data class AdminSysNoticePageResponse(
@field:Schema(description = "id is required", example = "")
var id: Long,
@field:Schema(description = "updateBy is not required", example = "")
var updateBy: String? = null,
)
Screenshots
-
wrong: KotlinDetector.isKotlinType(methodParameter.parameterType)
-
right: KotlinDetector.isKotlinType(methodParameter.containingClass)
-
fix: KotlinDetector.isKotlinType(methodParameter.containingClass)
is this fix code right?
Additional context
id dont know what fix use methodParameter.toKParameter()
?