Embedding the custom body model validation as a given Codec?

Ah, I did discover you can inline validations like this!

Am still curious how you would define a custom validator for a class like this though.