ozzo-validation icon indicating copy to clipboard operation
ozzo-validation copied to clipboard

add int rule

Open jakesylvestre opened this issue 4 years ago • 1 comments

As per some pr's that have been sitting around for a while (e.g. #93) and uncertainty as to how this framework is used in the larger ozzo project I wanted to make sure that this repo was still open before I spend too much time on this.

I've taken the int_rule functionality (and corresponding test case) I added in ozzo-validators and added it here. This allows you to validate structs on non-string fields.

For instance, IsValidPort and IsAvailablePort here validates on an int rather than a string.

Here's what that looks like in the context of a struct validation:

image

jakesylvestre avatar Jan 24 '21 20:01 jakesylvestre

Coverage Status

Coverage decreased (-0.2%) to 99.225% when pulling 393bfcd37b5d70587b109dbb1f7573f584474724 on xplorfin:int-rule into 34bd5476bd5bb4884aee8252974da4cd4e878a75 on go-ozzo:master.

coveralls avatar Jan 24 '21 20:01 coveralls