finos / spring-bot

Spring Boot + Java Integration for Symphony/Teams Chat Platform Bots and Apps
https://springbot.finos.org
Apache License 2.0
60 stars 35 forks source link

Template Generation Should Follow Jackson Conventions #230

Open robmoffat opened 3 years ago

robmoffat commented 3 years ago

Template generation currently inspects the fields on an object. It would make more sense if it used Jackson's approach of inspecting getters / setters.

Also ideally, if the user provides the annotations to inspect fields instead / ignore fields / whatever, then we should match this on the template too.

Reason is, then we can do a better job of mapping the form response to the JSON object.

robmoffat commented 2 years ago

So, the reason for doing this is that our templates would then match up with the JSON - at the moment, by adding Jackson annotations to fields, it would be possible for the JSON to be different to the template. Also, JSON is based on getters, whereas the template is based on the bean fields.

To make this change, we would need to modify AbstractComplexTypeConverter.getFields method, so that it called off to Jackson to get a list of the fields we needed.

robmoffat commented 2 years ago

This is a good first issue if you are quite familiar with how Jackson works