konform-kt / konform

Portable validations for Kotlin
https://www.konform.io
MIT License
652 stars 39 forks source link

How can i use this without reflection especially for java objects #14

Closed donpaul120 closed 1 day ago

hennihaus commented 2 years ago

Are there any solutions/updates to this question?

nlochschmidt commented 2 years ago

I must admit, I do not understand the request. Do you?

hennihaus commented 2 years ago

Hello @nlochschmidt ,

let me give you a small example of what @donpaul120 probably means. I have the following java class and want to validate this class with your awesome library:). Unfortunately, the required property must be called with a KProperty<*> type. Is there any way to get the KProperty of a java field or do you have another way to validate java classes without reflection in your project?

Bildschirmfoto 2022-06-26 um 13 48 46 Bildschirmfoto 2022-06-26 um 13 45 11

Thanks for your quick reply and best regards Henni

nlochschmidt commented 2 years ago

Aha, so the need is to validate the return value of some method on the class to be validated.

Sounds very different to the original question and definitely not possible as of today as konform is geared towards validating data classes.

I will consider supporting this, but contributions are welcome.

dhoepelman commented 4 months ago

Would be fixed by https://github.com/konform-kt/konform/pull/65

dhoepelman commented 1 day ago

Fixed by #65, will be included in 0.7.0