ScalaPB icon indicating copy to clipboard operation
ScalaPB copied to clipboard

Add information about which required field was missing

Open gregor-i opened this issue 1 year ago • 2 comments

Exceptions caused by missing required fields don't mention which fields were missing, even though this information is easy to provide

gregor-i avatar Nov 14 '24 20:11 gregor-i

Can you add unit tests? They can be based on e2e/src/main/protobuf/google/protobuf/unittest.proto and use TestRequired, TestRequiredForeign, and TestRequiredOneof, it should exercise the cases were one or more than one fields are missing.

thesamet avatar Nov 15 '24 00:11 thesamet

I've added some test cases. I didn't know how to construct incomplete messages, so my test data setup may be overcomplicated.

gregor-i avatar Nov 16 '24 11:11 gregor-i