0

I am trying to use the jackson-dataformat-properties library to parse the output from maven git commit id plugin into POJOs that I can later send as json from a Spring boot REST endpoint.

One of the complications is that the property file contains dynamic key names, like "git.remote.origin.url" where the "origin" segment can be any name.

Does anyone know a way to tell jacksons JavaPropsMapper to put any key that starts with "git.remote" into a Map? It will be impossible to maintain if I have to create a POJO named Remote with setOrigin method that takes an Origin POJO. If anyone use a different name for a remote repo the parsing will fail.

ola
  • 129
  • 1
  • 10
  • Does [this](https://stackoverflow.com/a/27863744/3206146) answer your question? – Andrei Prigorshnev Oct 14 '20 at 14:59
  • Try to use `@JsonAnySetter` annotation for unknown properties: [Jackson deserialization with unknown dynamic properties](https://stackoverflow.com/questions/17685508/jackson-deserialization-with-unknown-dynamic-properties/17698380#17698380) – Michał Ziober Oct 14 '20 at 19:50

0 Answers0