Skip to content
Advertisement

Build failed with UnrecognizedPropertyException: Unrecognized field error

In my JSON file I have defined customMetrics as

JavaScript

I have defined this customMetricCategory for different metrics in the same JSON file as

JavaScript

While running the repo in my local, build is failing with the following error:

JavaScript

Do I need to define anything else for this customMetricCategory? How can I get rid of this error?

TemplateColumn.java class

JavaScript

Also there is a TemplateCustomMetricheading.java class also define for the customMetricCategory

JavaScript

Advertisement

Answer

There are two ways to get rid of the error:

  1. Add the missing field private CustomMetricCategory customMetricCategory to the TemplateColumn class and implement related getter/setter to comply with the input JSON:
JavaScript

  1. Ignore failing on unknown properties when deserializing instances of TemplateColumn class.
JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement