I had the following code working and returning a statusCode.
final APIGatewayProxyResponseEvent responseEvent = new APIGatewayProxyResponseEvent();
responseEvent.setHeaders(Map.of(CONTENT_TYPE, APPLICATION_JSON));
responseEvent.setBody(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(response));
responseEvent.setStatusCode(200);
However i have recently updated the spring function adapter to 3.2.3, and i no longer recieve the status code in the response. In fact the response is now just the body.
My setup is aws lambda using spring function, behind api gateway.