Form variable length & name warning

Is there a built-in way to warn on form variable length or naming?

If not, I’ve been staring at the cht-conf tool a little too much lately, and it feels like the perfect hammer for this.

Our downstream system that pulls data from CouchDB recently ran into two issues:

  • we accidentally used a reserved word
  • due to deep nesting, some variables exceeded the allowed length

It seems like a natural fit to extend the config tool. Since it already has easy access to the bind entries, it could validate whether ref values:

  • exceed the allowed length
  • contain reserved words

This could run as part of the existing validation step.

For length, we could warn once a threshold is reached and error at a defined cutoff.
For a list of supplied reserved words, it probably makes sense to fail immediately.

The length check might also help discourage overly deep nesting or excessively verbose variable names

That said, it would be useful to have a way to explicitly ignore certain variables. Think cases where the length is known to be pushing the limits but simplifying it further would either introduce downstream issues or lose important context.

As for where this configuration should live, the <form>.properties file is looking like a good spot.

1 Like

Created issue and PR related to the above

1 Like