0

I want to have a configuration file in yaml format.

I want to have a configuration class in java that should be filled with the values of the file above.

I already found Jackson to pretty much exactly do this.

However I want to make sure that the file contains all values defined in the class. If I understand correctly, there is no direct way to ensure this using Jackson.

How do I detect if the file contains different (more/less/other) entries than expected by the class?


If I understand the answer to the other question correctly, they suggest first reading the config file no matter what is inside and then trying to validate the resulting object, which might kind of work, but completely misses the point. I want tell the user "you forgot to add a line in your config" instead of "some field in my object is not set".

michas
  • 25,361
  • 15
  • 76
  • 121

0 Answers0