0

How to deal with inheritence with Kotlin for Swagger targetted objects?

Just wondering if there is a way to do something like

@Schema(description = "Child.")
class Child(
    aName: String
): Human(aName)

@Schema(description = "Human beings.")
abstract class Human(
    @field:Schema(description = "The name.", nullable = false)
    var name: String
)

when doing that aName is a required property :( and cant apply @JsonIgnore on it

while if I override it it works, but a pain and workaround to me...

@Schema(description = "Child.")
class Child(
    override var name: String
): Human(name)

@Schema(description = "Human beings.")
abstract class Human(
    @field:Schema(description = "The name.", nullable = false)
    open var name: String
)

0