keithasaurus / koda-validate

Typesafe, Composable Validation
MIT License
112 stars 0 forks source link

Runtime Function Signature Validation #16

Closed keithasaurus closed 1 year ago

keithasaurus commented 1 year ago

Issue or goal of PR:

closes #11

What I did

I didn't include any of the public members of .signature in the root init.all object because I think this is fundamentally non-core. (The same approach is taken with .serialization).

I updated a lot of documentation! But still more on the way in this PR (it's a big PR, so review can start before that's done).

This PR is so large because some validators coerced by without any means of changing their behavior -- this is a problem for function signatures because presumably you don't want to pass an integer for a Decimal argument and have that implicitly coerced into a decimal. After the coercion API additions, resolve_signature_typehint_default now specifies how coercion (or lack thereof) is configured by default for function signature validation.

How to test

Most expected use cases are tested. It would be useful if there were any use cases I haven't thought of here that could be probed.

Documentation

Check one: