core-java icon indicating copy to clipboard operation
core-java copied to clipboard

Validate filtering client queries on the client

Open alexander-yevsyukov opened this issue 5 years ago • 1 comments

Suppose I want to subscribe to messages of a certain type filtering by the value of a field. Suppose I made a mistake in the name of the field. The mistake would result in server-side error because we don't validate the reference when the subscription is posted. This is:

  1. too late;
  2. hard to debug.

We need to have client-side validation of field references before the request is submitted to the server.

alexander-yevsyukov avatar Nov 09 '19 15:11 alexander-yevsyukov

It can be made via a mix-in interface. We know the name of the type, we can obtain the descriptor of the message. Get the field reference and see if the field is there.

alexander-yevsyukov avatar Nov 09 '19 15:11 alexander-yevsyukov