-
|
Hello, After some searches I didn't find my answer. Let's take directly an example. I have the following simple config file with a valid content: But I want that any unexpected properties must lead to a failure like this is the case for the following content: To fail on missing fields, I know it exists the method What about when having a class annotated with Is there a way to configure the Even if we can find solutions for missing fields, this isn't the same story for unexpected ones. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
For missing fields, Following test pass now: However, I didn't found any trivial way to add a constraint for unexpected fields by reading Configurate's source code. Maybe with additional searches something could be found, but finally I realized that this isn't really important in fact. So, I decided to abandon this idea. Having the possibility to add a constraint about required fields is enough for me and works. |
Beta Was this translation helpful? Give feedback.
For missing fields,
@Requiredannotation add the sought constraint. By taking back the example provided in the question, we obtain this result:Following test pass now: