I recommend take a look at https://dry-rb.org/gems/dry-validation/1.10
I has dry-schema where you can define nested json with expected types (and it will do coerce) and you can also add custom rules.
(I know this reply comes 4 days later :) but I just discovered now this question)