Joe,

Thanks for your reply.

As I'm thinking about it, validation of the property value isn't so much my problem. It's documentation.

If I mark the property documentation for both properties as required, then my consumer will wonder what supplying both would mean. However, one of the two, but never both is required. If both are supplied (whatever that would mean in the mind of the consumer), I ignore the template on the filesystem path since I check for the existence of the direct content property first.

Is this dilemma a candidate for the /customValidate/ method you mention?

Best,
Russ

On 05/12/2016 11:28 AM, Joe Witt wrote:
Russell,

Validators on property descriptors help with validating that property
alone.  But in the processor API there is 'customValidate' method you
can implement which is used to do things like compound/conditional
validation.

Thanks
Joe

On Thu, May 12, 2016 at 1:25 PM, Russell Bateman
<[email protected]> wrote:
How are folk specifying processor properties in the case where one of two
properties is required, but not both? I'm just wondering if there's a best
practice here or must I say something in the description?

For example, I've written a processor that implements Apache Velocity
templating. I require the template content be passed either directly as the
value of a property, "Template content", or a filesystem path to this
content in a property, "Template filepath".


Reply via email to