SMILEY4 / schema-kenerator

Analyze kotlin types, extract information and generate schemas
Apache License 2.0
4 stars 0 forks source link

Description annotation not work properly #4

Closed RaySmith-ttc closed 1 week ago

RaySmith-ttc commented 1 month ago

Descriptions are duplicated for the same types in a row: image

Model:

data class Foo(

    @Description("desc_a")
    val a: String,

    @Description("desc_b")
    val b: Int,

    @Description("desc_c")
    val c: Boolean,

    @Description("desc_d")
    val d: Boolean,

    @Description("desc_e")
    val e: Long
)

Configuration:

install(SwaggerUI) {
    schemas {
        generator = { type ->
            type
                .processReflection()
                .generateSwaggerSchema()
                .handleCoreAnnotations()
                .compileReferencingRoot()
        }
    }
}
SMILEY4 commented 1 month ago

Hi, thanks for reporting this bug. The issue should now be fixed with version 1.0.1 (and for ktor-swagger-ui soon aswell). I you encounter any other issues just let me know :)