swagger-parser icon indicating copy to clipboard operation
swagger-parser copied to clipboard

Version 2.1.28 seems to break oneOf

Open stratenh opened this issue 5 months ago • 0 comments

We have a Kotlin interface which gets implemented in multiple data classes:

@Schema(
    type = "object",
    oneOf = [A::class, B::class, C::class],
)
interface I {
    val userMessage: String
    val stepDataType: String
}

data class A(
    override val userMessage: String,
    @Schema(type = "enum", allowableValues = [INFO])
    override val classType: String = INFO,
) : I

data class B(
    override val userMessage: String,
    @Schema(type = "enum", allowableValues = [ERROR])
    override val classType: String = ERROR,
) : I

data class C(
    override val userMessage: String,
    val id: Int,
    val link: URI,
    @Schema(type = "enum", allowableValues = [FILE])
    override val classType: String = FILE,
) : I

This interface is used in a data class, which gets returned by the controller. In version 2.1.27 the return type got shown in the output. In version 2.1.28 the type got stripped. Is this a bug or do we need to change something?

stratenh avatar May 19 '25 13:05 stratenh