Greetings. I am thinking about how to expose Temporal workflow definitions as internal-APIs.
An aspect of that is validation. As payloads into the Java SDK are processed, they’ll flow through the DataConverter
implementations. In Java-world, obviously, validation is typically performed with javax.validation
annotations (JSR-303/330, etc.). Where’s the best place to mandate/force validation for all incoming payloads/arguments? I considered an interceptor, though I’m not sure they’re designed to handle errors (e.g. throwing instances of TemporalFailure
– I get weird behaviour if I try). Another idea might be to wrap the existing DataConverter
instances to trigger validation after de-serialization. Or, we have to code it directly into the workflow implementations.
Any suggestions would be welcome. Thanks!