i have a spring boot application which returns a Response Entity that holds a double value (0.00010). Since this is mapped to 1.0E-4, i would like to get 1.0E-4. Instead, i get 0.00. Is it possible that the Response Entity of a GET Request is not capable to return 1.0E-4?
@GetMapping( path = "/ui/contract/XYZ/{contractNumber}", produces = { MediaType.APPLICATION_JSON_VALUE } )
@EndpointAuthorization( action = ViewContract.class )
public ResponseEntity<Contract> getXYZContract( @ValidContractNumber @PathVariable String contractNumber ) throws IOException {
return getContractResponseEntity( contractNumber );
}
private ResponseEntity<Contract> getContractResponseEntity( String contractNumber ) {
log.debug( "getContract( {} )", contractNumber );
var contract = contractService.getContract( restContext.getPermissionContext(), contractNumber );
if( contractService.hasAllActions( contract, Set.of( ViewContract.class, ViewCustomer.class ) ) ) {
accessLogService.saveAccessLog( restContext.getPersonId(), contract );
}
Contract mappedContract = ContractMapper.map( contract );
log.debug( "Return XYZ-Contract: {}", mappedContract );
return ResponseEntity.ok( mappedContract );
}
From the HTTP Get Request i get:
"calculateXYZPercent": 0.00,
but i want it to be:
"calculateXYZPercent": 1.0E-4,
A breakpoint at line return ResponseEntity.ok( mappedContract );
shows that there, the value still is 1.0E-4.
Thank you guys in advance!