sideisra
sideisra

Reputation: 3

jqassistant returns null for ignoreUnknown Attribute of JsonIgnoreProperties annotation

In my project are some classes which are supposed to be de-/serialized via jackson. All of them should ignore unkown properties so i annotated them with @JsonIgnoreProperties(ignoreUnknown = true).

To ensure that all of them are properly annotated i tried to write a jqassistant rule to check the annotation but i am not able to read the value of ignoreUnknoen. All i get is null.

Query:

match
  (annotation:Annotation)-[:OF_TYPE]->(type:Type),
  (annotation)-[:HAS]->(ignoreUnknownAttribute:Value)
where
  type.fqn="com.fasterxml.jackson.annotation.JsonIgnoreProperties"
  and ignoreUnknownAttribute.name="ignoreUnknown"
return
  ignoreUnknownAttribute.VALUE as ingoreUnknown

Result:

found ignoreUnknown Attributes (2 which is correct) but without value

What am i doing wrong? ;-)

Upvotes: 0

Views: 68

Answers (1)

Dirk Mahler
Dirk Mahler

Reputation: 1266

The problem is in the return clause, the property name needs to be in lower case:

...
return
  ignoreUnknownAttribute.value as ingoreUnknown

Upvotes: 1

Related Questions