When adding a kotlind value class to a response, the property name is added twice. I tried different approaches with specifying schema, but wasn't able to correct or hide the additional property.
value class:
@JvmInline
value class IdWithOverwrittenSchema(val value: Long)
Response:
data class TestResponse(
@field:Schema(type = SchemaType.INTEGER, implementation = Long::class, name = "idWithOverwrittenSchema")
)
Resource:
@Path("/test")
class TestResource {
@GET
fun testMethod(): TestResponse {
return TestResponse()
}
}
When adding a kotlind value class to a response, the property name is added twice. I tried different approaches with specifying schema, but wasn't able to correct or hide the additional property.
value class:
Response:
Resource:
I tried different variations and put some of them in a sample project: https://github.com/dirkbolte/openapi-test
The result looks like this:
value classes as method parameters (e.g. on
@GET
with@PathParam
do not have this issue and are parsed correctly.Versions: