在我的项目中有一些应该通过jackson去序列化的类。所有这些都应该忽略未知属性,所以我用@JsonIgnoreProperties注释它们(ignoreUnknown = true)。
为了确保所有这些都被正确注释,我试着写一个jqassistant规则来检查注释,但我无法读取ignoreUnknoen的值。我得到的只是空。
查询:
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
结果:
found ignoreUnknown Attributes (2 which is correct) but without value
我做错了什么? ; - )
答案 0 :(得分:1)
问题出在return子句中,属性名称必须是小写:
...
return
ignoreUnknownAttribute.value as ingoreUnknown