Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ protected boolean processField(RootObjectMapper.Builder builder, String fieldNam
}
]
*/
if (!(fieldNode instanceof List)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small style nit: can you use ((fieldNode instanceof List) == false) instead? We prefer that kind of more verbose state to the negate operator for better readability throughout the codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbuescher ok I will fix for you suggest

throw new MapperParsingException("Dynamic template syntax error");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to provide some more information the user what went wrong. In this case it would be great to tell the user know that dynamic_templates expects an array of named objects or something along those lines.

}
List<?> tmplNodes = (List<?>) fieldNode;
List<DynamicTemplate> templates = new ArrayList<>();
for (Object tmplNode : tmplNodes) {
Expand Down