Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kotlin reflection support to ModelOptionsUtils #1667

Open
sdeleuze opened this issue Nov 4, 2024 · 0 comments
Open

Add Kotlin reflection support to ModelOptionsUtils #1667

sdeleuze opened this issue Nov 4, 2024 · 0 comments
Labels
enhancement New feature or request kotlin

Comments

@sdeleuze
Copy link
Contributor

sdeleuze commented Nov 4, 2024

As documented via #1666, schema generation from Kotlin classes currently requires using non idiomatic
code like data class Foo(@get:JsonProperty(required = true, value = "output") val bar: String) while the required information can be inferred from Kotlin null-safety and the value inferred from Kotlin reflection.

A related com.github.victools.jsonschema.generator.Module instance could be implemented and created when KotlinDetector.isKotlinReflectPresent() == true to provide those information automatically here.

That would allow to perform schema generation with just data class Foo(val bar: String).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kotlin
Projects
None yet
Development

No branches or pull requests

1 participant