JsonSchemaBytebufValidator ignores the length parameter
I noticed that JsonSchemaBytebufValidator and JsonSyntaxBytebufValidatorboth ignore thelength` parameter and just validate the whole buffer.
https://github.com/kroxylicious/kroxylicious/blob/9fbc622fe19fe1aec6297576e86b4d066f7b3665/kroxylicious-filters/kroxylicious-record-validation/src/main/java/io/kroxylicious/proxy/filter/schema/validation/bytebuf/JsonSchemaBytebufValidator.java#L32
The javadoc warns:
* @param length the length of the value in the buffer (buffer may contain more data after the value)
The javadoc for org.apache.kafka.common.record.Record does not state whether the caller may read beyond the key/value size however from the implementation of DefaultRecord you can see that they they are backed by slices that are right sized.
I also note that in classes like io.kroxylicious.filter.encryption.encrypt.RecordEncryptor, we assume the buffers can be read to the end.
I believe the length parameter is superfluous.
@robobario low priority, but I'd value your thoughts on this.
I agree, we should remove it and update the javadoc about the input buffer