There is the code in the @RestController:
@GetMapping("update_odds")
public Optional<OddsJSON> updateOdds() {
return eventService.updateOdds();
}
Result of this method in the browser:
{
present: true
}
Is it possible to configure Jackson mapper to output the value of Optional?
Just need to add to the pom.xml file:
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
<version>2.6.3</version>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With