Johann Pardanaud
10/12/2023, 1:18 PMJohann Pardanaud
10/12/2023, 1:18 PMJohann Pardanaud
10/12/2023, 1:21 PMJohann Pardanaud
10/12/2023, 1:42 PMJohann Pardanaud
10/16/2023, 12:16 PMList<String>
) but now you can also create a generic class and apply the @Validate
annotation on it.
• Built-in accessors for basic Kotlin types. Now you can easily access and validate properties of many Kotlin types. You want to access the keys of a Map
? Just write keys
and apply the constraints you want on it.
A lot of new ideas came to me while working on this release, expect a roadmap update soon!dave08
10/16/2023, 2:41 PMdave08
10/16/2023, 2:53 PMSupport generating accessors for 3rd party types
in the roadmap any comments... but I think that's one of the main blockers for me to make my own adapter for Strikt in my unit tests, because I don't really want to annotate my production code with @Validate
when I'm only using it in test code... it seems like the typealias might help for that...dave08
10/16/2023, 2:59 PM@Validate
, would Akkurate generate all the accessors for the classes it refers to @Johann Pardanaud?Johann Pardanaud
10/16/2023, 6:46 PMdave08
10/17/2023, 11:50 AMimplementation("dev.nesk.akkurate:akkurate-ksp-plugin:0.3.0")
has to be included as implementation
? It's only the ksp plugin, no? I haven't seen that in other ksp libs AFAIK...Johann Pardanaud
10/17/2023, 11:51 AM@Validate
annotation is part of the KSP plugin, which is why you need it as an implementation toodave08
10/17/2023, 1:47 PMval validateInstallActionList = dev.nesk.akkurate.Validator<List<InstallAction>> {
// ....?
}
(notice that Intellij had troubles importing Validator
...?)dave08
10/17/2023, 3:22 PMdave08
10/18/2023, 12:45 PMRonny Bräunlich
10/20/2023, 6:34 AMValidationResult
class instead of e.g. using Arrow's Either
. I guess the latter would make for a better interoperability.dave08
10/29/2023, 10:36 AM.bind()
and function with Raise
that returns the success's value, or raises the error or exception... but then maybe both error types should be encapsulated in their own sealed interface? That would avoid the overhead of having to convert to Either just to bind or raise etc...Johann Pardanaud
10/30/2023, 1:18 PMValidator<List<Any>?> { each { ... } }
• The configuration of a Validator
has been revamped to a DSL builder.
What to expect in the next weeks 🦠
• Better documentation: Kdoc for every public symbol, and server validation tutorials
• The first integration in a long series: arrow ArrowJohann Pardanaud
11/11/2023, 6:03 PMrocketraman
11/14/2023, 2:47 PMPATCH
is impossible to do with the same types, because the incoming data is incomplete, so even if the server-side code can deserialize it (unlikely), we still need to know which subset of fields was actually sent by the client.
I had implemented https://github.com/rocketraman/kpropmap to deal with these scenarios in the past. The idea is to receive the data from the API in a flexible way, and then do validation and conversion to the strongly typed model on the server-side.
Any thoughts on introducing a similar capability to Akkurate? I've long wanted, but haven't had the time to have kpropmap use KSP and kotlinx-serialization rather than runtime reflection, and Akkurate already uses these tools.Johann Pardanaud
11/17/2023, 4:04 PMJohann Pardanaud
11/17/2023, 4:05 PMJohann Pardanaud
11/29/2023, 12:44 PM