SMILEY4 / ktor-swagger-ui

Kotlin Ktor plugin to generate OpenAPI and provide Swagger UI
Apache License 2.0
182 stars 33 forks source link

Expose Swagger Schema annotation dependency #156

Open Him188 opened 3 weeks ago

Him188 commented 3 weeks ago

The documentation mentioned using swagger Schema is supported, however the library does not expose the dependency so the consumer can't easily use it. The consumer must find itself the correct dependency and manually add it:

    implementation("io.swagger.core.v3:swagger-annotations:2.2.21")
    implementation("io.swagger.core.v3:swagger-models:2.2.21")

For a majority of simple cases, annotating @Schema on the data class is much easier than using the schema DSL. So I think it's beneficial to enable this feature by default.

SMILEY4 commented 2 weeks ago

Hi, thank you for the suggestion. I'm not 100% sure i want to expose specific additional library versions. Do you think including a hint in the wiki/readme that these dependencies can be added would also work? This would at least remove the need to manually search for them in another place.

Him188 commented 2 weeks ago

Yes a hint would also work. The actual problem is searching for the correct one to add so once you provide it through the readme, it's fixed. Thanks for considering this!